aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 402eead8b6..b3edc9b8e4 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -316,6 +316,8 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV) {
CE->destroyConstant();
}
+ // Delete the old global, now that it is dead.
+ Globals.erase(GV);
++NumSRA;
return NewGlobals[0];
}