summaryrefslogtreecommitdiff
path: root/lib/TableGen/TGParser.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-01-04 03:05:14 +0000
committerCraig Topper <craig.topper@gmail.com>2016-01-04 03:05:14 +0000
commitae62636ef881aa040e9c550cccb8404a4598a957 (patch)
treef178dd6c06f796e8677822150e557b3cfe758865 /lib/TableGen/TGParser.h
parent8d08283a5affcdd34ea709c4c17f05803d6df3d5 (diff)
[TableGen] Fix a bug that caused the wrong name for a record built from a multiclass containing a defm called NAME that references another multiclass that contains a defm that uses NAME concatenated with other strings.
It would end up doing the concatenations from the second multiclass twice. This occured because SetValue detected a self assignment when trying to set the value of NAME to a VarInit called NAME. NAME is special here and it will get cleaned up later. So add a flag to suppress the self assignment check for this case. Strangely the self-assignment error was returning false indicating it wasn't an error, but it wasn't doing the right thing. So this also changes it to report an error. This fixes the names of some AVX512 FMA instructions that showed this double expansion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen/TGParser.h')
-rw-r--r--lib/TableGen/TGParser.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/TableGen/TGParser.h b/lib/TableGen/TGParser.h
index 8b41134d4ff..b4407041908 100644
--- a/lib/TableGen/TGParser.h
+++ b/lib/TableGen/TGParser.h
@@ -105,10 +105,13 @@ public:
private: // Semantic analysis methods.
bool AddValue(Record *TheRec, SMLoc Loc, const RecordVal &RV);
bool SetValue(Record *TheRec, SMLoc Loc, Init *ValName,
- const std::vector<unsigned> &BitList, Init *V);
+ const std::vector<unsigned> &BitList, Init *V,
+ bool AllowSelfAssignment = false);
bool SetValue(Record *TheRec, SMLoc Loc, const std::string &ValName,
- const std::vector<unsigned> &BitList, Init *V) {
- return SetValue(TheRec, Loc, StringInit::get(ValName), BitList, V);
+ const std::vector<unsigned> &BitList, Init *V,
+ bool AllowSelfAssignment = false) {
+ return SetValue(TheRec, Loc, StringInit::get(ValName), BitList, V,
+ AllowSelfAssignment);
}
bool AddSubClass(Record *Rec, SubClassReference &SubClass);
bool AddSubMultiClass(MultiClass *CurMC,