There is no EndPtr anymore - reinterpret the original comment in terms
[oota-llvm.git] / include / llvm / Support / ValueHandle.h
index a9872a7be1c31429572b6d866a464fd05adf844c..c0cdc35e99bfae5a541f8f8a2180c36ce321a914 100644 (file)
@@ -254,15 +254,18 @@ struct DenseMapInfo<AssertingVH<T> > {
   static bool isEqual(const AssertingVH<T> &LHS, const AssertingVH<T> &RHS) {
     return LHS == RHS;
   }
-  static bool isPod() {
+};
+  
+template <typename T>
+struct isPodLike<AssertingVH<T> > {
 #ifdef NDEBUG
-    return true;
+  static const bool value = true;
 #else
-    return false;
+  static const bool value = false;
 #endif
-  }
 };
 
+
 /// TrackingVH - This is a value handle that tracks a Value (or Value subclass),
 /// even across RAUW operations.
 ///
@@ -281,8 +284,7 @@ class TrackingVH : public ValueHandleBase {
     Value *VP = ValueHandleBase::getValPtr();
 
     // Null is always ok.
-    if (!VP)
-        return;
+    if (!VP) return;
 
     // Check that this value is valid (i.e., it hasn't been deleted). We
     // explicitly delay this check until access to avoid requiring clients to be
@@ -299,7 +301,7 @@ class TrackingVH : public ValueHandleBase {
 
   ValueTy *getValPtr() const {
     CheckValidity();
-    return static_cast<ValueTy*>(ValueHandleBase::getValPtr());
+    return (ValueTy*)ValueHandleBase::getValPtr();
   }
   void setValPtr(ValueTy *P) {
     CheckValidity();
@@ -313,7 +315,7 @@ class TrackingVH : public ValueHandleBase {
 
 public:
   TrackingVH() : ValueHandleBase(Tracking) {}
-  TrackingVH(ValueTy *P) : ValueHandleBase(Tracking, P) {}
+  TrackingVH(ValueTy *P) : ValueHandleBase(Tracking, GetAsValue(P)) {}
   TrackingVH(const TrackingVH &RHS) : ValueHandleBase(Tracking, RHS) {}
 
   operator ValueTy*() const {