diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-03-24 19:37:00 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-03-24 19:37:00 +0000 |
commit | 99ffcc83e6872f7535d009d7150df4bd12953bc5 (patch) | |
tree | 652fe2ddd29bfb6c03d163b8760955f5a145e518 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 91a5848cab499b280bbab58b4896af4a20f826fc (diff) | |
download | bcm5719-llvm-99ffcc83e6872f7535d009d7150df4bd12953bc5.tar.gz bcm5719-llvm-99ffcc83e6872f7535d009d7150df4bd12953bc5.zip |
Allow types to be omitted in output patterns.
This syntax is now preferred:
def : Pat<(subc i32:$b, i32:$c), (SUBCCrr $b, $c)>;
There is no reason to repeat the types in the output pattern.
llvm-svn: 177844
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 7f9f88ed40a..8e5bb7760f6 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1866,6 +1866,16 @@ TreePatternNode *TreePattern::ParseTreePattern(Init *TheInit, StringRef OpName){ return Res; } + // ?:$name or just $name. + if (TheInit == UnsetInit::get()) { + if (OpName.empty()) + error("'?' argument requires a name to match with operand list"); + TreePatternNode *Res = new TreePatternNode(TheInit, 1); + Args.push_back(OpName); + Res->setName(OpName); + return Res; + } + if (IntInit *II = dyn_cast<IntInit>(TheInit)) { if (!OpName.empty()) error("Constant int argument should not have a name!"); |