diff options
author | David Greene <greened@obbligato.org> | 2011-10-19 13:04:02 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2011-10-19 13:04:02 +0000 |
commit | 22dde7e655b76f75bf11e86129410a7dcbfac3ba (patch) | |
tree | 7238026bd3abc0603797a5b5aba83b7e291296fe /lib/TableGen/TGParser.cpp | |
parent | 69a2394b2dd0136581f1485d69669246fc3b62c5 (diff) |
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
Diffstat (limited to 'lib/TableGen/TGParser.cpp')
-rw-r--r-- | lib/TableGen/TGParser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index b06b8db800..45625f98d9 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); |