commit | 8f57e9c083b1e1aa9677e83284969ab65b975821 | [log] [tgz] |
---|---|---|
author | Chris Lattner <sabre@nondot.org> | Fri Oct 08 22:05:31 2004 +0000 |
committer | Chris Lattner <sabre@nondot.org> | Fri Oct 08 22:05:31 2004 +0000 |
tree | c46f314b92573d21b88a58979f008efc844d5704 | |
parent | a4be1dc0a192175bbc561a633c0b7197853e6a74 [diff] |
If we found a dead global, we should at least delete it... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16858 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 5c46053..dcbd87d 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -364,6 +364,7 @@ if (GV->use_empty()) { DEBUG(std::cerr << "GLOBAL DEAD: " << *GV); + GV->getParent()->getGlobalList().erase(GV); ++NumDeleted; return true; }