diff options
author | David Greene <greened@obbligato.org> | 2009-06-08 17:00:34 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2009-06-08 17:00:34 +0000 |
commit | 07eba05a610bb1711c2d9e798ad72df0ddf90249 (patch) | |
tree | e3edf39277f259509fba97aaf71af1cb7e7a05b2 /llvm/utils/TableGen/TGParser.cpp | |
parent | 6f998fcb1d2ebc37a255e1a5ba25e2d2cc5a611d (diff) | |
download | bcm5719-llvm-07eba05a610bb1711c2d9e798ad72df0ddf90249.tar.gz bcm5719-llvm-07eba05a610bb1711c2d9e798ad72df0ddf90249.zip |
Add a !regmatch operator to do pattern matching in TableGen.
llvm-svn: 73074
Diffstat (limited to 'llvm/utils/TableGen/TGParser.cpp')
-rw-r--r-- | llvm/utils/TableGen/TGParser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/TGParser.cpp b/llvm/utils/TableGen/TGParser.cpp index fc6f29fd9f1..b4d448b1e8c 100644 --- a/llvm/utils/TableGen/TGParser.cpp +++ b/llvm/utils/TableGen/TGParser.cpp @@ -791,6 +791,7 @@ Init *TGParser::ParseOperation(Record *CurRec) { case tgtok::XSRL: case tgtok::XSHL: case tgtok::XStrConcat: + case tgtok::XRegMatch: case tgtok::XNameConcat: { // Value ::= !binop '(' Value ',' Value ')' BinOpInit::BinaryOp Code; RecTy *Type = 0; @@ -823,6 +824,11 @@ Init *TGParser::ParseOperation(Record *CurRec) { Code = BinOpInit::STRCONCAT; Type = new StringRecTy(); break; + case tgtok::XRegMatch: + Lex.Lex(); // eat the operation + Code = BinOpInit::REGMATCH; + Type = new IntRecTy(); + break; case tgtok::XNameConcat: Lex.Lex(); // eat the operation Code = BinOpInit::NAMECONCAT; @@ -1174,6 +1180,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec) { case tgtok::XSRL: case tgtok::XSHL: case tgtok::XStrConcat: + case tgtok::XRegMatch: case tgtok::XNameConcat: // Value ::= !binop '(' Value ',' Value ')' case tgtok::XIf: case tgtok::XForEach: |