diff options
| author | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
|---|---|---|
| committer | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
| commit | 38500d63e14ce340236840f60d356cdefb56a52c (patch) | |
| tree | 17edbec446ce9b50d2f215a483b83afb293a635d /llvm/lib/TableGen/TGParser.cpp | |
| parent | 1a3d5daaef7a6a63448a497da3eff7fc9e23df26 (diff) | |
| parent | 27f30029741ecf023baece7b3dde1ff9011ffefc (diff) | |
Merge branch 'main' into users/meinersbur/flang_runtime_split-headersusers/meinersbur/flang_runtime_split-headers
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
| -rw-r--r-- | llvm/lib/TableGen/TGParser.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index e01342ffcd3c..e8679439c81d 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -969,7 +969,7 @@ const TypedInit *TGParser::ParseSliceElements(Record *CurRec, bool Single) { /// RangePiece ::= INTVAL /// RangePiece ::= INTVAL '...' INTVAL /// RangePiece ::= INTVAL '-' INTVAL -/// RangePiece ::= INTVAL INTVAL +/// RangePiece ::= INTVAL INTVAL // The last two forms are deprecated. bool TGParser::ParseRangePiece(SmallVectorImpl<unsigned> &Ranges, const TypedInit *FirstItem) { @@ -1203,7 +1203,8 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) { case tgtok::XEmpty: case tgtok::XCast: case tgtok::XRepr: - case tgtok::XGetDagOp: { // Value ::= !unop '(' Value ')' + case tgtok::XGetDagOp: + case tgtok::XInitialized: { // Value ::= !unop '(' Value ')' UnOpInit::UnaryOp Code; const RecTy *Type = nullptr; @@ -1291,6 +1292,11 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) { } Code = UnOpInit::GETDAGOP; break; + case tgtok::XInitialized: + Lex.Lex(); // eat the operation + Code = UnOpInit::INITIALIZED; + Type = IntRecTy::get(Records); + break; } if (!consume(tgtok::l_paren)) { TokError("expected '(' after unary operator"); @@ -1655,8 +1661,8 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) { !ArgType->typeIsConvertibleTo(StringRecTy::get(Records)) && !ArgType->typeIsConvertibleTo(RecordRecTy::get(Records, {}))) { Error(InitLoc, Twine("expected bit, bits, int, string, or record; " - "got value of type '") + ArgType->getAsString() + - "'"); + "got value of type '") + + ArgType->getAsString() + "'"); return nullptr; } break; @@ -1669,8 +1675,8 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) { if (!ArgType->typeIsConvertibleTo(IntRecTy::get(Records)) && !ArgType->typeIsConvertibleTo(StringRecTy::get(Records))) { Error(InitLoc, Twine("expected bit, bits, int, or string; " - "got value of type '") + ArgType->getAsString() + - "'"); + "got value of type '") + + ArgType->getAsString() + "'"); return nullptr; } break; @@ -2528,7 +2534,7 @@ const Init *TGParser::ParseOperationForEachFilter(Record *CurRec, OutType = RHSt->getType()->getListTy(); } else if (Operation == tgtok::XFilter) { OutType = InEltType->getListTy(); - } + } return (TernOpInit::get((Operation == tgtok::XForEach) ? TernOpInit::FOREACH : TernOpInit::FILTER, @@ -3504,7 +3510,7 @@ bool TGParser::ParseBodyItem(Record *CurRec) { RecordVal *Field = CurRec->getValue(FieldName); if (!Field) - return TokError("Value '" + FieldName->getValue() + "' unknown!"); + return Error(IdLoc, "Value '" + FieldName->getValue() + "' unknown!"); const RecTy *Type = Field->getType(); if (!BitList.empty() && isa<BitsRecTy>(Type)) { @@ -3548,7 +3554,7 @@ bool TGParser::ParseBody(Record *CurRec) { SMLoc SemiLoc = Lex.getLoc(); if (consume(tgtok::semi)) { PrintError(SemiLoc, "A class or def body should not end with a semicolon"); - PrintNote("Semicolon ignored; remove to eliminate this error"); + PrintNote("Semicolon ignored; remove to eliminate this error"); } return false; @@ -4218,7 +4224,7 @@ bool TGParser::ParseMultiClass() { SMLoc SemiLoc = Lex.getLoc(); if (consume(tgtok::semi)) { PrintError(SemiLoc, "A multiclass body should not end with a semicolon"); - PrintNote("Semicolon ignored; remove to eliminate this error"); + PrintNote("Semicolon ignored; remove to eliminate this error"); } } |
