[llvm-commits] [llvm] r56455 - in /llvm/branches/ggreif/use-diet: include/llvm/Use.h include/llvm/Value.h lib/VMCore/Use.cpp

Gabor Greif ggreif at gmail.com
Mon Sep 22 12:42:39 PDT 2008


Author: ggreif
Date: Mon Sep 22 14:42:39 2008
New Revision: 56455

URL: http://llvm.org/viewvc/llvm-project?rev=56455&view=rev
Log:
get rid of most references to Use::Val1

Modified:
    llvm/branches/ggreif/use-diet/include/llvm/Use.h
    llvm/branches/ggreif/use-diet/include/llvm/Value.h
    llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp

Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=56455&r1=56454&r2=56455&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Mon Sep 22 14:42:39 2008
@@ -92,7 +92,7 @@
 
   /// Destructor - Only for zap()
   inline ~Use() {
-    if (Val1) removeFromList();
+    if (!isNil(Next)) removeFromList();
   }
 
   /// Default ctor - This leaves the Use completely uninitialized.  The only thing
@@ -130,7 +130,7 @@
     return RHS;
   }
   const Use &operator=(const Use &RHS) {
-    set(RHS.Val1);
+    set(RHS.get());
     return *this;
   }
 
@@ -141,7 +141,6 @@
 			   ? 0
 			   : stripTag<tagMaskN>(Next); }
 private:
-  Value *Val1;
   Use *Next, **Prev;
 
   void setPrev(Use **NewPrev) {
@@ -241,7 +240,7 @@
 Value *Use::get() const {
   return fullStopTagN == extractTag<NextPtrTag, tagMaskN>(Next)
     ? reinterpret_cast<Value*>(stripTag<tagMaskN>(Next))
-    : (Val1 == getValue() ? Val1 : 0); // should crash if not equal!
+    : getValue();
 }
 
 template<> struct simplify_type<value_use_iterator<User> > {

Modified: llvm/branches/ggreif/use-diet/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Value.h?rev=56455&r1=56454&r2=56455&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Value.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Value.h Mon Sep 22 14:42:39 2008
@@ -233,14 +233,12 @@
 }
 
 void Use::init(Value *V, User *user) {
-  Val1 = V;
   if (V) V->addUse(*this);
   else Next = nilUse(0);
 }
 
 void Use::set(Value *V) {
-  if (Val1) removeFromList();
-  Val1 = V;
+  if (isNil(Next)) removeFromList();
   if (V) V->addUse(*this);
   else Next = nilUse(0);
 }

Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=56455&r1=56454&r2=56455&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Mon Sep 22 14:42:39 2008
@@ -89,7 +89,6 @@
   ptrdiff_t Count = Done;
   while (Start != Stop) {
     --Stop;
-    Stop->Val1 = 0;
     Stop->Next = nilUse(0);
     if (!Count) {
       Stop->Prev = reinterpret_cast<Use**>(Done == 0 ? fullStopTag : stopTag);





More information about the llvm-commits mailing list