[llvm-commits] CVS: llvm/lib/VMCore/Globals.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jul 18 17:55:45 PDT 2004



Changes in directory llvm/lib/VMCore:

Globals.cpp updated: 1.2 -> 1.3

---
Log message:

Method now returns null, dtor is inlined


---
Diffs of the changes:  (+3 -13)

Index: llvm/lib/VMCore/Globals.cpp
diff -u llvm/lib/VMCore/Globals.cpp:1.2 llvm/lib/VMCore/Globals.cpp:1.3
--- llvm/lib/VMCore/Globals.cpp:1.2	Sun Jul 18 03:12:57 2004
+++ llvm/lib/VMCore/Globals.cpp	Sun Jul 18 19:55:35 2004
@@ -50,25 +50,15 @@
 /// This function returns true if the global value is now dead.  If all 
 /// users of this global are not dead, this method may return false and
 /// leave some of them around.
-bool GlobalValue::removeDeadConstantUsers() {
+void GlobalValue::removeDeadConstantUsers() {
   while(!use_empty()) {
     if (Constant* User = dyn_cast<Constant>(use_back())) {
       if (!::removeDeadConstantUsers(User))
-        return false; // Constant wasn't dead
+        return; // Constant wasn't dead
     } else {
-      return false; // Non-constant usage;
+      return; // Non-constant usage;
     }
   }
-  return true;
-}
-
-/// This virtual destructor is responsible for deleting any transitively dead
-/// Constants that are using the GlobalValue.
-GlobalValue::~GlobalValue() {
-  // Its an error to attempt destruction with non-constant uses remaining.
-  bool okay_to_destruct = removeDeadConstantUsers();
-  assert(okay_to_destruct && 
-         "Can't destroy GlobalValue with non-constant uses.");
 }
 
 /// Override destroyConstant to make sure it doesn't get called on 





More information about the llvm-commits mailing list