Expand the pass to unify all of the unwind blocks as well
[oota-llvm.git] / include / llvm / Analysis / DSSupport.h
index cc989f77361297f42a9e4a4d0e249560485e92dc..aff7abcb6ecbe6bced9c54c86531fad9cfec8f9c 100644 (file)
@@ -7,12 +7,10 @@
 #ifndef LLVM_ANALYSIS_DSSUPPORT_H
 #define LLVM_ANALYSIS_DSSUPPORT_H
 
-#include <assert.h>
-
 #include <vector>
 #include <functional>
 #include <string>
-#include "Support/HashExtras.h"
+#include <cassert>
 #include "Support/hash_set"
 
 class Function;
@@ -61,6 +59,7 @@ public:
   }
   ~DSNodeHandle() { setNode((DSNode*)0); }
   DSNodeHandle &operator=(const DSNodeHandle &H) {
+    if (&H == this) return *this;  // Don't set offset to 0 if self assigning.
     Offset = 0; setNode(H.getNode()); Offset = H.Offset;
     return *this;
   }
@@ -194,6 +193,15 @@ public:
       InitNH(CallArgs[i], FromCall.CallArgs[i], NodeMap);
   }
 
+  const DSCallSite &operator=(const DSCallSite &RHS) {
+    Inst     = RHS.Inst;
+    CalleeF  = RHS.CalleeF;
+    CalleeN  = RHS.CalleeN;
+    RetVal   = RHS.RetVal;
+    CallArgs = RHS.CallArgs;
+    return *this;
+  }
+
   /// isDirectCall - Return true if this call site is a direct call of the
   /// function specified by getCalleeFunc.  If not, it is an indirect call to
   /// the node specified by getCalleeNode.