diff options
author | David Greene <greened@obbligato.org> | 2011-10-19 13:03:51 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2011-10-19 13:03:51 +0000 |
commit | 91919cd8166bb60145efe54dd790b98521b4328a (patch) | |
tree | 44238ca1c49447ad5f0429b0b807d89a5e90a029 /lib/TableGen | |
parent | 2c49fbb32c5f042ecf64ac415f1a628100951a44 (diff) | |
download | external_llvm-91919cd8166bb60145efe54dd790b98521b4328a.zip external_llvm-91919cd8166bb60145efe54dd790b98521b4328a.tar.gz external_llvm-91919cd8166bb60145efe54dd790b98521b4328a.tar.bz2 |
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@142515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen')
-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 5dc25e9..1e5b55f 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -1694,8 +1694,9 @@ bool TGParser::ParseDef(MultiClass *CurMultiClass) { } else { // Otherwise, a def inside a multiclass, add it to the multiclass. for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size(); i != e; ++i) - if (CurMultiClass->DefPrototypes[i]->getName() == CurRec->getName()) { - Error(DefLoc, "def '" + CurRec->getName() + + if (CurMultiClass->DefPrototypes[i]->getNameInit() + == CurRec->getNameInit()) { + Error(DefLoc, "def '" + CurRec->getNameInitAsString() + "' already defined in this multiclass!"); return true; } |