aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/TGParser.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-05-14 21:22:49 +0000
committerDavid Greene <greened@obbligato.org>2009-05-14 21:22:49 +0000
commite6c27de069225e1122c78385ad22a2ff656db8e6 (patch)
treebf1ff9c77caee5b28119d5760b34a6fd530023ed /utils/TableGen/TGParser.cpp
parentd418c1b768b5ff26afe05a5ce84d920bbbc99583 (diff)
Implement !cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/TGParser.cpp')
-rw-r--r--utils/TableGen/TGParser.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/utils/TableGen/TGParser.cpp b/utils/TableGen/TGParser.cpp
index da2a5304ab..6b4c431635 100644
--- a/utils/TableGen/TGParser.cpp
+++ b/utils/TableGen/TGParser.cpp
@@ -680,41 +680,41 @@ Init *TGParser::ParseOperation(Record *CurRec) {
TokError("unknown operation");
return 0;
break;
-// case tgtok::XCast: { // Value ::= !unop '(' Value ')'
-// UnOpInit::UnaryOp Code;
-// RecTy *Type = 0;
+ case tgtok::XCast: { // Value ::= !unop '(' Value ')'
+ UnOpInit::UnaryOp Code;
+ RecTy *Type = 0;
-// switch (Lex.getCode()) {
-// default: assert(0 && "Unhandled code!");
-// case tgtok::XCast:
-// Lex.Lex(); // eat the operation
-// Code = UnOpInit::CAST;
+ switch (Lex.getCode()) {
+ default: assert(0 && "Unhandled code!");
+ case tgtok::XCast:
+ Lex.Lex(); // eat the operation
+ Code = UnOpInit::CAST;
-// Type = ParseOperatorType();
+ Type = ParseOperatorType();
-// if (Type == 0) {
-// TokError("did not get type for binary operator");
-// return 0;
-// }
+ if (Type == 0) {
+ TokError("did not get type for binary operator");
+ return 0;
+ }
-// break;
-// }
-// if (Lex.getCode() != tgtok::l_paren) {
-// TokError("expected '(' after unary operator");
-// return 0;
-// }
-// Lex.Lex(); // eat the '('
+ break;
+ }
+ if (Lex.getCode() != tgtok::l_paren) {
+ TokError("expected '(' after unary operator");
+ return 0;
+ }
+ Lex.Lex(); // eat the '('
-// Init *LHS = ParseValue(CurRec);
-// if (LHS == 0) return 0;
+ Init *LHS = ParseValue(CurRec);
+ if (LHS == 0) return 0;
-// if (Lex.getCode() != tgtok::r_paren) {
-// TokError("expected ')' in unary operator");
-// return 0;
-// }
-// Lex.Lex(); // eat the ')'
-// return (new UnOpInit(Code, LHS, Type))->Fold(CurRec, CurMultiClass);
-// }
+ if (Lex.getCode() != tgtok::r_paren) {
+ TokError("expected ')' in unary operator");
+ return 0;
+ }
+ Lex.Lex(); // eat the ')'
+ return (new UnOpInit(Code, LHS, Type))->Fold(CurRec, CurMultiClass);
+ }
case tgtok::XConcat:
case tgtok::XSRA:
@@ -1029,7 +1029,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec) {
case tgtok::l_paren: { // Value ::= '(' IDValue DagArgList ')'
Lex.Lex(); // eat the '('
if (Lex.getCode() != tgtok::Id
- // && Lex.getCode() != tgtok::XCast
+ && Lex.getCode() != tgtok::XCast
&& Lex.getCode() != tgtok::XNameConcat) {
TokError("expected identifier in dag init");
return 0;
@@ -1072,7 +1072,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec) {
break;
}
- // case tgtok::XCast: // Value ::= !unop '(' Value ')'
+ case tgtok::XCast: // Value ::= !unop '(' Value ')'
case tgtok::XConcat:
case tgtok::XSRA:
case tgtok::XSRL: