diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-08 18:36:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-08 18:36:19 +0000 |
commit | 43e4754817cfdd0e48e3dbe005211f1df4875f1f (patch) | |
tree | a53ed946e5ac6110cf1bc394e33e435343bd9597 | |
parent | e00ed57087874369d9db02f5115b7bdbdce748e0 (diff) | |
download | external_llvm-43e4754817cfdd0e48e3dbe005211f1df4875f1f.zip external_llvm-43e4754817cfdd0e48e3dbe005211f1df4875f1f.tar.gz external_llvm-43e4754817cfdd0e48e3dbe005211f1df4875f1f.tar.bz2 |
Node arguments to type casts can have names too. This code
needs to be majorly refactored, but this spot bugfix allows
things like:
def vmrghw_shuffle : PatFrag<(ops node:$lhs, node:$rhs),
(vector_shuffle (v4i32 node:$lhs), node:$rhs), [{
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97952 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index ce737bf..e793333 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1238,6 +1238,14 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) { std::vector<std::pair<Init*, std::string> >())); return ParseTreePattern(Dag); } + + // Input argument? + if (R->getName() == "node") { + if (Dag->getArgName(0).empty()) + error("'node' argument requires a name to match with operand list"); + Args.push_back(Dag->getArgName(0)); + } + New = new TreePatternNode(DI); } else if (DagInit *DI = dynamic_cast<DagInit*>(Arg)) { New = ParseTreePattern(DI); |