Fix Name Access
authorDavid Greene <greened@obbligato.org>
Wed, 19 Oct 2011 13:03:58 +0000 (13:03 +0000)
committerDavid Greene <greened@obbligato.org>
Wed, 19 Oct 2011 13:03:58 +0000 (13:03 +0000)
Get the Record name as a string explicitly to avoid asserts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142516 91177308-0d34-0410-b5e6-96231b3b80d8

lib/TableGen/TGParser.cpp

index 1e5b55fdf93397dc3602aca45cd99672ff817cf7..b06b8db8003c7b47fe07d32f8263201a4893e302 100644 (file)
@@ -1747,7 +1747,8 @@ bool TGParser::ParseClass() {
     if (!CurRec->getValues().empty() ||
         !CurRec->getSuperClasses().empty() ||
         !CurRec->getTemplateArgs().empty())
-      return TokError("Class '" + CurRec->getName() + "' already defined");
+      return TokError("Class '" + CurRec->getNameInitAsString()
+                      + "' already defined");
   } else {
     // If this is the first reference to this class, create and add it.
     CurRec = new Record(Lex.getCurStrVal(), Lex.getLoc(), Records);