[llvm-commits] [llvm] r78119 - in /llvm/trunk: include/llvm/Value.h include/llvm/ValueSymbolTable.h lib/Bitcode/Writer/BitcodeWriter.cpp lib/VMCore/Value.cpp

Chris Lattner sabre at nondot.org
Tue Aug 4 16:07:18 PDT 2009


Author: lattner
Date: Tue Aug  4 18:07:12 2009
New Revision: 78119

URL: http://llvm.org/viewvc/llvm-project?rev=78119&view=rev
Log:
revert r78048, it isn't worth using assertingvh here.

Modified:
    llvm/trunk/include/llvm/Value.h
    llvm/trunk/include/llvm/ValueSymbolTable.h
    llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
    llvm/trunk/lib/VMCore/Value.cpp

Modified: llvm/trunk/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=78119&r1=78118&r2=78119&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Value.h (original)
+++ llvm/trunk/include/llvm/Value.h Tue Aug  4 18:07:12 2009
@@ -38,7 +38,7 @@
 template<typename ValueTy> class StringMapEntry;
 template <typename ValueTy = Value>
 class AssertingVH;
-typedef StringMapEntry<AssertingVH<> > ValueName;
+typedef StringMapEntry<Value*> ValueName;
 class raw_ostream;
 class AssemblyAnnotationWriter;
 class ValueHandleBase;

Modified: llvm/trunk/include/llvm/ValueSymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ValueSymbolTable.h?rev=78119&r1=78118&r2=78119&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ValueSymbolTable.h (original)
+++ llvm/trunk/include/llvm/ValueSymbolTable.h Tue Aug  4 18:07:12 2009
@@ -17,7 +17,6 @@
 #include "llvm/Value.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/Support/DataTypes.h"
-#include "llvm/Support/ValueHandle.h"
 
 namespace llvm {
   template<typename ValueSubClass, typename ItemParentClass>
@@ -45,7 +44,7 @@
 /// @{
 public:
   /// @brief A mapping of names to values.
-  typedef StringMap<AssertingVH<> > ValueMap;
+  typedef StringMap<Value*> ValueMap;
 
   /// @brief An iterator over a ValueMap.
   typedef ValueMap::iterator iterator;

Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=78119&r1=78118&r2=78119&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Tue Aug  4 18:07:12 2009
@@ -1088,7 +1088,7 @@
     // VST_ENTRY:   [valueid, namechar x N]
     // VST_BBENTRY: [bbid, namechar x N]
     unsigned Code;
-    if (isa<BasicBlock>(*SI->getValue())) {
+    if (isa<BasicBlock>(SI->getValue())) {
       Code = bitc::VST_CODE_BBENTRY;
       if (isChar6)
         AbbrevToUse = VST_BBENTRY_6_ABBREV;

Modified: llvm/trunk/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=78119&r1=78118&r2=78119&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Value.cpp (original)
+++ llvm/trunk/lib/VMCore/Value.cpp Tue Aug  4 18:07:12 2009
@@ -57,14 +57,6 @@
 }
 
 Value::~Value() {
-  // If this value is named, destroy the name.  This should not be in a symtab
-  // at this point.
-  if (Name)
-    Name->Destroy();
-  
-  // There should be no uses of this object anymore, remove it.
-  LeakDetector::removeGarbageObject(this);
-  
   // Notify all ValueHandles (if present) that this value is going away.
   if (HasValueHandle)
     ValueHandleBase::ValueIsDeleted(this);
@@ -84,6 +76,14 @@
   }
 #endif
   assert(use_empty() && "Uses remain when a value is destroyed!");
+
+  // If this value is named, destroy the name.  This should not be in a symtab
+  // at this point.
+  if (Name)
+    Name->Destroy();
+  
+  // There should be no uses of this object anymore, remove it.
+  LeakDetector::removeGarbageObject(this);
 }
 
 /// hasNUses - Return true if this Value has exactly N users.





More information about the llvm-commits mailing list