Fix Name Access

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

llvm-svn: 142515
This commit is contained in:
David Greene 2011-10-19 13:03:51 +00:00
parent 3a20f5a687
commit 07e055f919
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}