aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-19 00:55:35 +0000
committerChris Lattner <sabre@nondot.org>2004-07-19 00:55:35 +0000
commitf8083b7f20e0985b3c1848d25a56b1f527c0a255 (patch)
treebc7216628aa8f1f442c5b3020edd24be644f72f2 /lib/VMCore
parentf962ac798a87bbb04df1d5518454f25cca172d9b (diff)
downloadexternal_llvm-f8083b7f20e0985b3c1848d25a56b1f527c0a255.zip
external_llvm-f8083b7f20e0985b3c1848d25a56b1f527c0a255.tar.gz
external_llvm-f8083b7f20e0985b3c1848d25a56b1f527c0a255.tar.bz2
Method now returns null, dtor is inlined
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Globals.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp
index e35d801..ea87701 100644
--- a/lib/VMCore/Globals.cpp
+++ b/lib/VMCore/Globals.cpp
@@ -50,25 +50,15 @@ static bool removeDeadConstantUsers(Constant* C) {
/// 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