diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-17 01:27:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-17 01:27:29 +0000 |
commit | c642b84fb866c3a6f1e61d39d6eda89563267b53 (patch) | |
tree | f89b22670abe14f9e9671c203d8050c25af8b74f /utils/TableGen/DAGISelMatcherGen.cpp | |
parent | e74c3bae3aa6ea5add53afed4181d4da5a7eee18 (diff) | |
download | llvm-c642b84fb866c3a6f1e61d39d6eda89563267b53.tar.gz llvm-c642b84fb866c3a6f1e61d39d6eda89563267b53.tar.bz2 llvm-c642b84fb866c3a6f1e61d39d6eda89563267b53.tar.xz |
prefix captured value names with $ so they look like
variables. Use the fancy OpNo variable instead of i,
which has the right index including chains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcherGen.cpp')
-rw-r--r-- | utils/TableGen/DAGISelMatcherGen.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp index 5591cfb2a8..345b964c2d 100644 --- a/utils/TableGen/DAGISelMatcherGen.cpp +++ b/utils/TableGen/DAGISelMatcherGen.cpp @@ -249,7 +249,7 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N, for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i, ++OpNo) { // Get the code suitable for matching this child. Move to the child, check // it then move back to the parent. - AddMatcherNode(new MoveChildMatcherNode(i)); + AddMatcherNode(new MoveChildMatcherNode(OpNo)); EmitMatchCode(N->getChild(i), NodeNoTypes->getChild(i)); AddMatcherNode(new MoveParentMatcherNode()); } @@ -267,7 +267,6 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N, InferPossibleTypes(); } - // If this node has a name associated with it, capture it in VariableMap. If // we already saw this in the pattern, emit code to verify dagness. if (!N->getName().empty()) { @@ -288,7 +287,7 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N, NumRecorded += 2; // Input and output chains. } else { // If it is a normal named node, we must emit a 'Record' opcode. - AddMatcherNode(new RecordMatcherNode(N->getName())); + AddMatcherNode(new RecordMatcherNode("$" + N->getName())); NumRecorded = 1; } NextRecordedOperandNo += NumRecorded; |