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
This commit is contained in:
David Greene
2009-06-08 17:00:34 +00:00
parent 06bfa33eef
commit 938c8ab0a0
7 changed files with 57 additions and 2 deletions

View File

@@ -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: