diff options
author | David Greene <greened@obbligato.org> | 2011-10-05 22:42:54 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2011-10-05 22:42:54 +0000 |
commit | caa25c81cd12f8a25b6cb7a3cba865a0dbcd4eaf (patch) | |
tree | b75f11b2229d09bd951c563981441251aae2fdb8 /lib | |
parent | 6494af4d7797ef2240e628a0fd045231afafaeeb (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/TableGen/TGParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index ed51977c3d..97240481fc 100644 --- a/lib/TableGen/TGParser.cpp +++ b/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??"); |