From: David Greene Date: Wed, 19 Oct 2011 13:04:02 +0000 (+0000) Subject: Fix Name Access X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=22dde7e655b76f75bf11e86129410a7dcbfac3ba;p=oota-llvm.git Fix Name Access Get the Record name as a string explicitly to avoid asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142517 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index b06b8db8003..45625f98d98 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -2021,8 +2021,9 @@ bool TGParser::ResolveMulticlassDef(MultiClass &MC, 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);