From 47a665e93e586e609dc59750f9216656bf5b8cb1 Mon Sep 17 00:00:00 2001 From: David Greene Date: Wed, 5 Oct 2011 22:42:54 +0000 Subject: [PATCH] Prefix Template Arg Names with Multiclass Name For consistency, prefix multiclass template arg names with the multiclass name followed by "::" to avoid name clashes among multiclass arguments and other entities in the multiclass. llvm-svn: 141239 --- llvm/lib/TableGen/TGParser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index ed51977c3d01..97240481fcbb 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -650,6 +650,9 @@ Init *TGParser::ParseIDValue(Record *CurRec, return VarInit::get(Name, RV->getType()); std::string TemplateArgName = CurRec->getName()+":"+Name; + if (CurMultiClass) + TemplateArgName = CurMultiClass->Rec.getName()+"::"+TemplateArgName; + if (CurRec->isTemplateArg(TemplateArgName)) { const RecordVal *RV = CurRec->getValue(TemplateArgName); assert(RV && "Template arg doesn't exist??");