summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/DAGISelMatcherGen.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-17 01:27:29 +0000
committerChris Lattner <sabre@nondot.org>2010-02-17 01:27:29 +0000
commitac27c2e3f3cd2527bf50fd114ebc3387d36f678a (patch)
treefa634c0f5b9e8be26cd1156f6128996b3748a9d2 /llvm/utils/TableGen/DAGISelMatcherGen.cpp
parent84a85fcb91f4881011c734d767932b631321a3b6 (diff)
downloadbcm5719-llvm-ac27c2e3f3cd2527bf50fd114ebc3387d36f678a.tar.gz
bcm5719-llvm-ac27c2e3f3cd2527bf50fd114ebc3387d36f678a.zip
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. llvm-svn: 96436
Diffstat (limited to 'llvm/utils/TableGen/DAGISelMatcherGen.cpp')
-rw-r--r--llvm/utils/TableGen/DAGISelMatcherGen.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index 5591cfb2a88..345b964c2d1 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud