eliminate the MatcherNodeWithChild class, give the 'child'

field to MatcherNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-02-18 02:49:24 +00:00
parent f6afae2f49
commit 8ef9c7958a
4 changed files with 53 additions and 67 deletions

View File

@@ -221,7 +221,7 @@ EmitMatcher(const MatcherNode *N, unsigned Indent) {
unsigned MatcherTableEmitter::
EmitMatcherAndChildren(const MatcherNode *N, unsigned Indent) {
unsigned Size = 0;
while (1) {
while (N) {
// Push is a special case since it is binary.
if (const PushMatcherNode *PMN = dyn_cast<PushMatcherNode>(N)) {
// We need to encode the child and the offset of the failure code before
@@ -256,11 +256,9 @@ EmitMatcherAndChildren(const MatcherNode *N, unsigned Indent) {
// If there are children of this node, iterate to them, otherwise we're
// done.
if (const MatcherNodeWithChild *MNWC = dyn_cast<MatcherNodeWithChild>(N))
N = MNWC->getChild();
else
return Size;
N = N->getChild();
}
return Size;
}
void MatcherTableEmitter::EmitPredicateFunctions() {