[llvm-commits] [llvm] r53925 - /llvm/trunk/include/llvm/CodeGen/SelectionDAG.h

Dan Gohman gohman at apple.com
Tue Jul 22 11:04:23 PDT 2008


Author: djg
Date: Tue Jul 22 13:04:23 2008
New Revision: 53925

URL: http://llvm.org/viewvc/llvm-project?rev=53925&view=rev
Log:
Assert that the DAG root value is a chain value.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAG.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=53925&r1=53924&r2=53925&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Jul 22 13:04:23 2008
@@ -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 @@
 
   /// 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





More information about the llvm-commits mailing list