[llvm-commits] [llvm] r142517 - /llvm/trunk/lib/TableGen/TGParser.cpp

David Greene greened at obbligato.org
Wed Oct 19 06:04:02 PDT 2011


Author: greened
Date: Wed Oct 19 08:04:02 2011
New Revision: 142517

URL: http://llvm.org/viewvc/llvm-project?rev=142517&view=rev
Log:
Fix Name Access

Get the Record name as a string explicitly to avoid asserts.

Modified:
    llvm/trunk/lib/TableGen/TGParser.cpp

Modified: llvm/trunk/lib/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.cpp?rev=142517&r1=142516&r2=142517&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp (original)
+++ llvm/trunk/lib/TableGen/TGParser.cpp Wed Oct 19 08:04:02 2011
@@ -2021,8 +2021,9 @@
   if (CurMultiClass) {
     for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size();
          i != e; ++i)
-      if (CurMultiClass->DefPrototypes[i]->getName() == CurRec->getName())
-        return Error(DefmPrefixLoc, "defm '" + CurRec->getName() +
+      if (CurMultiClass->DefPrototypes[i]->getNameInit()
+          == CurRec->getNameInit())
+        return Error(DefmPrefixLoc, "defm '" + CurRec->getNameInitAsString() +
                      "' already defined in this multiclass!");
     CurMultiClass->DefPrototypes.push_back(CurRec);
 





More information about the llvm-commits mailing list