mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-31 09:25:42 +00:00
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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user