summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2011-10-19 13:03:51 +0000
committerDavid Greene <greened@obbligato.org>2011-10-19 13:03:51 +0000
commit07e055f919debdbe81cf398e10667d3701cb7e48 (patch)
treeb3c5bbcd4c4c44015f80d37292b954d2977d3134 /llvm/lib/TableGen
parent3a20f5a6878909a2aa3b5da2c70305a964333491 (diff)
downloadbcm5719-llvm-07e055f919debdbe81cf398e10667d3701cb7e48.tar.gz
bcm5719-llvm-07e055f919debdbe81cf398e10667d3701cb7e48.zip
Fix Name Access
Get the Record name as a string explicitly to avoid asserts. llvm-svn: 142515
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index 5dc25e9827a..1e5b55fdf93 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud