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 | 938c8ab0a0f4a52d7d6ddc975abe9de08fee06d5 (patch) | |
| tree | 790c1f084b25650896b3b08b8811e9bb0d52d692 /utils/TableGen/TGParser.cpp | |
| parent | 06bfa33eefd6c7b56fc354ab640a9175e82bf890 (diff) | |
Add a !regmatch operator to do pattern matching in TableGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/TGParser.cpp')
| -rw-r--r-- | utils/TableGen/TGParser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/TableGen/TGParser.cpp b/utils/TableGen/TGParser.cpp index fc6f29fd9f..b4d448b1e8 100644 --- a/utils/TableGen/TGParser.cpp +++ b/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: |
