diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-22 18:04:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-22 18:04:23 +0000 |
commit | acaf09dbe4a6781163857db1321bbd5795e7d410 (patch) | |
tree | b1f0f2c5ef066be28bc468dcd2bae1208422ec4f | |
parent | 54ce536a2d4400e6921bf29c879046900893aeae (diff) | |
download | external_llvm-acaf09dbe4a6781163857db1321bbd5795e7d410.zip external_llvm-acaf09dbe4a6781163857db1321bbd5795e7d410.tar.gz external_llvm-acaf09dbe4a6781163857db1321bbd5795e7d410.tar.bz2 |
Assert that the DAG root value is a chain value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53925 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/SelectionDAG.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 2b9382b..fee46b3 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -19,6 +19,7 @@ #include "llvm/ADT/StringMap.h" #include "llvm/CodeGen/SelectionDAGNodes.h" +#include <cassert> #include <list> #include <vector> #include <map> @@ -127,7 +128,11 @@ public: /// setRoot - Set the current root tag of the SelectionDAG. /// - const SDOperand &setRoot(SDOperand N) { return Root = N; } + const SDOperand &setRoot(SDOperand N) { + assert((!N.Val || N.getValueType() == MVT::Other) && + "DAG root value is not a chain!"); + return Root = N; + } /// Combine - This iterates over the nodes in the SelectionDAG, folding /// certain types of nodes together, or eliminating superfluous nodes. When |