diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-18 02:53:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-18 02:53:41 +0000 |
commit | 186ad8098e609d34657814c38df07d7dc07784cd (patch) | |
tree | 386037d2d17cca4fa40315e667a9e27dfcbf248f /llvm/utils/TableGen/DAGISelMatcherEmitter.cpp | |
parent | d582a367b5f7dd74d8835a23ad9b05bd437013a8 (diff) | |
download | bcm5719-llvm-186ad8098e609d34657814c38df07d7dc07784cd.tar.gz bcm5719-llvm-186ad8098e609d34657814c38df07d7dc07784cd.zip |
rename the child field to 'next'. This is not a parent/child
relationship, this is a linear list relationship.
llvm-svn: 96561
Diffstat (limited to 'llvm/utils/TableGen/DAGISelMatcherEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcherEmitter.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp index ea134fe9d2f..5d468194d79 100644 --- a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp +++ b/llvm/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"; |