diff options
author | Paul C. Anagnostopoulos <paul@windfall.com> | 2020-12-31 14:50:51 -0500 |
---|---|---|
committer | Paul C. Anagnostopoulos <paul@windfall.com> | 2021-01-07 09:31:27 -0500 |
commit | aa7968a87b65f97c1245348f6c2a75fc9e420bb5 (patch) | |
tree | 1f1a8e9f72ab168922ef625715eda16e31921e80 /llvm/lib/TableGen/TGParser.cpp | |
parent | b73736a4048172c48b6b5c23d1321f230d442306 (diff) | |
download | llvm-aa7968a87b65f97c1245348f6c2a75fc9e420bb5.zip llvm-aa7968a87b65f97c1245348f6c2a75fc9e420bb5.tar.gz llvm-aa7968a87b65f97c1245348f6c2a75fc9e420bb5.tar.bz2 |
[TableGen] Add field kind to the RecordVal class.
Differential Revision: https://reviews.llvm.org/D93969
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r-- | llvm/lib/TableGen/TGParser.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index ebb66cc..c217c01 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -95,7 +95,7 @@ static void checkConcrete(Record &R) { // done merely because existing targets have legitimate cases of // non-concrete variables in helper defs. Ideally, we'd introduce a // 'maybe' or 'optional' modifier instead of this. - if (RV.getPrefix()) + if (RV.isNonconcreteOK()) continue; if (Init *V = RV.getValue()) { @@ -1596,8 +1596,9 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { ParseRec = ParseRecTmp.get(); } - ParseRec->addValue(RecordVal(A, Start->getType(), false)); - ParseRec->addValue(RecordVal(B, ListType->getElementType(), false)); + ParseRec->addValue(RecordVal(A, Start->getType(), RecordVal::FK_Normal)); + ParseRec->addValue(RecordVal(B, ListType->getElementType(), + RecordVal::FK_Normal)); Init *ExprUntyped = ParseValue(ParseRec); ParseRec->removeValue(A); ParseRec->removeValue(B); @@ -1845,7 +1846,7 @@ Init *TGParser::ParseOperationForEachFilter(Record *CurRec, RecTy *ItemType) { ParseRec = ParseRecTmp.get(); } - ParseRec->addValue(RecordVal(LHS, InEltType, false)); + ParseRec->addValue(RecordVal(LHS, InEltType, RecordVal::FK_Normal)); Init *RHS = ParseValue(ParseRec, ExprEltType); ParseRec->removeValue(LHS); if (!RHS) @@ -2618,8 +2619,10 @@ Init *TGParser::ParseDeclaration(Record *CurRec, "::"); } - // Add the value. - if (AddValue(CurRec, IdLoc, RecordVal(DeclName, IdLoc, Type, HasField))) + // Add the field to the record. + if (AddValue(CurRec, IdLoc, RecordVal(DeclName, IdLoc, Type, + HasField ? RecordVal::FK_NonconcreteOK + : RecordVal::FK_Normal))) return nullptr; // If a value is present, parse it. |