summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-19 21:37:09 +0000
committerChris Lattner <sabre@nondot.org>2010-03-19 21:37:09 +0000
commitd7349194650386d97a1d779369cb46f20ba9f252 (patch)
treecc4a508d79ee2f79a1b69a199bd500f788db29cb /utils/TableGen/DAGISelEmitter.cpp
parent0157f50437bc47c7dceec286a6f671f597fdfc18 (diff)
downloadllvm-d7349194650386d97a1d779369cb46f20ba9f252.tar.gz
llvm-d7349194650386d97a1d779369cb46f20ba9f252.tar.bz2
llvm-d7349194650386d97a1d779369cb46f20ba9f252.tar.xz
major surgery on tblgen: generalize TreePatternNode
to maintain a list of types (one for each result of the node) instead of a single type. There are liberal hacks added to emulate the old behavior in various situations, but they can start disolving now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelEmitter.cpp')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index ef9b734511..044086add5 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -25,7 +25,6 @@ using namespace llvm;
/// patterns before small ones. This is used to determine the size of a
/// pattern.
static unsigned getPatternSize(TreePatternNode *P, CodeGenDAGPatterns &CGP) {
- assert(P->hasTypeSet() && "Not a valid pattern node to size!");
unsigned Size = 3; // The node itself.
// If the root node is a ConstantSDNode, increases its size.
// e.g. (set R32:$dst, 0).
@@ -49,7 +48,8 @@ static unsigned getPatternSize(TreePatternNode *P, CodeGenDAGPatterns &CGP) {
// Count children in the count if they are also nodes.
for (unsigned i = 0, e = P->getNumChildren(); i != e; ++i) {
TreePatternNode *Child = P->getChild(i);
- if (!Child->isLeaf() && Child->getType() != MVT::Other)
+ if (!Child->isLeaf() && Child->getNumTypes() &&
+ Child->getType(0) != MVT::Other)
Size += getPatternSize(Child, CGP);
else if (Child->isLeaf()) {
if (dynamic_cast<IntInit*>(Child->getLeafValue()))