From 96470065433e6a54db8b26813ef2151cd5051028 Mon Sep 17 00:00:00 2001 From: David Greene Date: Wed, 19 Oct 2011 13:03:45 +0000 Subject: [PATCH] Fix Name Access Get the Record name by string explicitly to avoid potential asserts. llvm-svn: 142514 --- lib/TableGen/TGParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index e913bce705a..5dc25e9827a 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -1686,7 +1686,8 @@ bool TGParser::ParseDef(MultiClass *CurMultiClass) { // Ensure redefinition doesn't happen. if (Records.getDef(CurRec->getName())) { - Error(DefLoc, "def '" + CurRec->getName() + "' already defined"); + Error(DefLoc, "def '" + CurRec->getNameInitAsString() + + "' already defined"); return true; } Records.addDef(CurRec);