aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/DAGISelMatcherEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-18 02:53:41 +0000
committerChris Lattner <sabre@nondot.org>2010-02-18 02:53:41 +0000
commitbd8227f5298f0ab7b96203a6d3875e5d26573376 (patch)
tree357790bfab723800f0f55b68e7fa1d4f51193ec6 /utils/TableGen/DAGISelMatcherEmitter.cpp
parent8ef9c7958ad7a23ad15d7ff59e1377aec10ca42a (diff)
downloadexternal_llvm-bd8227f5298f0ab7b96203a6d3875e5d26573376.zip
external_llvm-bd8227f5298f0ab7b96203a6d3875e5d26573376.tar.gz
external_llvm-bd8227f5298f0ab7b96203a6d3875e5d26573376.tar.bz2
rename the child field to 'next'. This is not a parent/child
relationship, this is a linear list relationship. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcherEmitter.cpp')
-rw-r--r--utils/TableGen/DAGISelMatcherEmitter.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/utils/TableGen/DAGISelMatcherEmitter.cpp b/utils/TableGen/DAGISelMatcherEmitter.cpp
index ea134fe..5d46819 100644
--- a/utils/TableGen/DAGISelMatcherEmitter.cpp
+++ b/utils/TableGen/DAGISelMatcherEmitter.cpp
@@ -76,7 +76,7 @@ class MatcherTableEmitter {
public:
MatcherTableEmitter(formatted_raw_ostream &os) : OS(os) {}
- unsigned EmitMatcherAndChildren(const MatcherNode *N, unsigned Indent);
+ unsigned EmitMatcherList(const MatcherNode *N, unsigned Indent);
void EmitPredicateFunctions();
private:
@@ -217,9 +217,9 @@ EmitMatcher(const MatcherNode *N, unsigned Indent) {
return 0;
}
-/// EmitMatcherAndChildren - Emit the bytes for the specified matcher subtree.
+/// EmitMatcherList - Emit the bytes for the specified matcher subtree.
unsigned MatcherTableEmitter::
-EmitMatcherAndChildren(const MatcherNode *N, unsigned Indent) {
+EmitMatcherList(const MatcherNode *N, unsigned Indent) {
unsigned Size = 0;
while (N) {
// Push is a special case since it is binary.
@@ -228,25 +228,25 @@ EmitMatcherAndChildren(const MatcherNode *N, unsigned Indent) {
// emitting either of them. Handle this by buffering the output into a
// string while we get the size.
SmallString<128> TmpBuf;
- unsigned ChildSize;
+ unsigned NextSize;
{
raw_svector_ostream OS(TmpBuf);
formatted_raw_ostream FOS(OS);
- ChildSize =
- EmitMatcherAndChildren(cast<PushMatcherNode>(N)->getChild(),Indent+1);
+ NextSize = EmitMatcherList(cast<PushMatcherNode>(N)->getNext(),
+ Indent+1);
}
- if (ChildSize > 255) {
+ if (NextSize > 255) {
errs() <<
"Tblgen internal error: can't handle predicate this complex yet\n";
exit(1);
}
OS.PadToColumn(Indent*2);
- OS << "OPC_Push, " << ChildSize << ",\n";
+ OS << "OPC_Push, " << NextSize << ",\n";
OS << TmpBuf.str();
- Size += 2 + ChildSize;
+ Size += 2 + NextSize;
N = PMN->getFailure();
continue;
@@ -254,9 +254,9 @@ EmitMatcherAndChildren(const MatcherNode *N, unsigned Indent) {
Size += EmitMatcher(N, Indent);
- // If there are children of this node, iterate to them, otherwise we're
+ // If there are other nodes in this list, iterate to them, otherwise we're
// done.
- N = N->getChild();
+ N = N->getNext();
}
return Size;
}
@@ -311,7 +311,7 @@ void llvm::EmitMatcherTable(const MatcherNode *Matcher, raw_ostream &O) {
MatcherTableEmitter MatcherEmitter(OS);
OS << " static const unsigned char MatcherTable[] = {\n";
- unsigned TotalSize = MatcherEmitter.EmitMatcherAndChildren(Matcher, 2);
+ unsigned TotalSize = MatcherEmitter.EmitMatcherList(Matcher, 2);
OS << " 0\n }; // Total Array size is " << (TotalSize+1) << " bytes\n\n";
OS << " return SelectCodeCommon(N, MatcherTable,sizeof(MatcherTable));\n}\n";
OS << "\n";