[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Oct 18 21:31:07 PDT 2005
Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.62 -> 1.63
---
Log message:
Add basic support for integer constants in pattern results.
---
Diffs of the changes: (+14 -0)
DAGISelEmitter.cpp | 14 ++++++++++++++
1 files changed, 14 insertions(+)
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.62 llvm/utils/TableGen/DAGISelEmitter.cpp:1.63
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.62 Tue Oct 18 21:07:26 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Oct 18 23:30:56 2005
@@ -665,8 +665,15 @@
Args.push_back(Dag->getArgName(i));
}
}
+ } else if (IntInit *II = dynamic_cast<IntInit*>(Arg)) {
+ TreePatternNode *Node = new TreePatternNode(II);
+ if (!Dag->getArgName(i).empty())
+ error("Constant int argument should not have a name!");
+ Children.push_back(Node);
} else {
+ std::cerr << '"';
Arg->dump();
+ std::cerr << "\": ";
error("Unknown leaf value for tree pattern!");
}
}
@@ -1627,6 +1634,13 @@
<< ");\n";
return ResNo;
}
+ } else if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) {
+ unsigned ResNo = Ctr++;
+ OS << " SDOperand Tmp" << ResNo << " = CurDAG->getTargetConstant("
+ << II->getValue() << ", MVT::"
+ << getEnumName(N->getType())
+ << ");\n";
+ return ResNo;
}
N->dump();
More information about the llvm-commits
mailing list