@@ -969,7 +969,7 @@ const TypedInit *TGParser::ParseSliceElements(Record *CurRec, bool Single) {
969969// / RangePiece ::= INTVAL
970970// / RangePiece ::= INTVAL '...' INTVAL
971971// / RangePiece ::= INTVAL '-' INTVAL
972- // / RangePiece ::= INTVAL INTVAL
972+ // / RangePiece ::= INTVAL INTVAL
973973// The last two forms are deprecated.
974974bool TGParser::ParseRangePiece (SmallVectorImpl<unsigned > &Ranges,
975975 const TypedInit *FirstItem) {
@@ -1203,7 +1203,8 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) {
12031203 case tgtok::XEmpty:
12041204 case tgtok::XCast:
12051205 case tgtok::XRepr:
1206- case tgtok::XGetDagOp: { // Value ::= !unop '(' Value ')'
1206+ case tgtok::XGetDagOp:
1207+ case tgtok::XInitialized: { // Value ::= !unop '(' Value ')'
12071208 UnOpInit::UnaryOp Code;
12081209 const RecTy *Type = nullptr ;
12091210
@@ -1291,6 +1292,11 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) {
12911292 }
12921293 Code = UnOpInit::GETDAGOP;
12931294 break ;
1295+ case tgtok::XInitialized:
1296+ Lex.Lex (); // eat the operation
1297+ Code = UnOpInit::INITIALIZED;
1298+ Type = IntRecTy::get (Records);
1299+ break ;
12941300 }
12951301 if (!consume (tgtok::l_paren)) {
12961302 TokError (" expected '(' after unary operator" );
@@ -1655,8 +1661,8 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) {
16551661 !ArgType->typeIsConvertibleTo (StringRecTy::get (Records)) &&
16561662 !ArgType->typeIsConvertibleTo (RecordRecTy::get (Records, {}))) {
16571663 Error (InitLoc, Twine (" expected bit, bits, int, string, or record; "
1658- " got value of type '" ) + ArgType-> getAsString () +
1659- " '" );
1664+ " got value of type '" ) +
1665+ ArgType-> getAsString () + " '" );
16601666 return nullptr ;
16611667 }
16621668 break ;
@@ -1669,8 +1675,8 @@ const Init *TGParser::ParseOperation(Record *CurRec, const RecTy *ItemType) {
16691675 if (!ArgType->typeIsConvertibleTo (IntRecTy::get (Records)) &&
16701676 !ArgType->typeIsConvertibleTo (StringRecTy::get (Records))) {
16711677 Error (InitLoc, Twine (" expected bit, bits, int, or string; "
1672- " got value of type '" ) + ArgType-> getAsString () +
1673- " '" );
1678+ " got value of type '" ) +
1679+ ArgType-> getAsString () + " '" );
16741680 return nullptr ;
16751681 }
16761682 break ;
@@ -2528,7 +2534,7 @@ const Init *TGParser::ParseOperationForEachFilter(Record *CurRec,
25282534 OutType = RHSt->getType ()->getListTy ();
25292535 } else if (Operation == tgtok::XFilter) {
25302536 OutType = InEltType->getListTy ();
2531- }
2537+ }
25322538
25332539 return (TernOpInit::get ((Operation == tgtok::XForEach) ? TernOpInit::FOREACH
25342540 : TernOpInit::FILTER,
@@ -3548,7 +3554,7 @@ bool TGParser::ParseBody(Record *CurRec) {
35483554 SMLoc SemiLoc = Lex.getLoc ();
35493555 if (consume (tgtok::semi)) {
35503556 PrintError (SemiLoc, " A class or def body should not end with a semicolon" );
3551- PrintNote (" Semicolon ignored; remove to eliminate this error" );
3557+ PrintNote (" Semicolon ignored; remove to eliminate this error" );
35523558 }
35533559
35543560 return false ;
@@ -4218,7 +4224,7 @@ bool TGParser::ParseMultiClass() {
42184224 SMLoc SemiLoc = Lex.getLoc ();
42194225 if (consume (tgtok::semi)) {
42204226 PrintError (SemiLoc, " A multiclass body should not end with a semicolon" );
4221- PrintNote (" Semicolon ignored; remove to eliminate this error" );
4227+ PrintNote (" Semicolon ignored; remove to eliminate this error" );
42224228 }
42234229 }
42244230
0 commit comments