From 07e055f919debdbe81cf398e10667d3701cb7e48 Mon Sep 17 00:00:00 2001 From: David Greene Date: Wed, 19 Oct 2011 13:03:51 +0000 Subject: [PATCH] Fix Name Access Get the Record name as a string explicitly to avoid asserts. llvm-svn: 142515 --- llvm/lib/TableGen/TGParser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 5dc25e9827a6..1e5b55fdf933 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; }