Assert that the DAG root value is a chain value.
authorDan Gohman <gohman@apple.com>
Tue, 22 Jul 2008 18:04:23 +0000 (18:04 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 22 Jul 2008 18:04:23 +0000 (18:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53925 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAG.h

index 2b9382b2b6764542d6e67b2fe03cd5fb423d0bf3..fee46b32a6e8de0986612be78ed92fa629c8df87 100644 (file)
@@ -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