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
This commit is contained in:
David Greene 2011-10-05 22:42:54 +00:00
parent 4fff1e2f5e
commit 47a665e93e
1 changed files with 3 additions and 0 deletions

View File

@ -650,6 +650,9 @@ Init *TGParser::ParseIDValue(Record *CurRec,
return VarInit::get(Name, RV->getType()); return VarInit::get(Name, RV->getType());
std::string TemplateArgName = CurRec->getName()+":"+Name; std::string TemplateArgName = CurRec->getName()+":"+Name;
if (CurMultiClass)
TemplateArgName = CurMultiClass->Rec.getName()+"::"+TemplateArgName;
if (CurRec->isTemplateArg(TemplateArgName)) { if (CurRec->isTemplateArg(TemplateArgName)) {
const RecordVal *RV = CurRec->getValue(TemplateArgName); const RecordVal *RV = CurRec->getValue(TemplateArgName);
assert(RV && "Template arg doesn't exist??"); assert(RV && "Template arg doesn't exist??");