summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRForTarget.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2010-11-02 23:51:17 +0000
committerSean Callanan <scallanan@apple.com>2010-11-02 23:51:17 +0000
commit951f6ce9032ed4b913a9bbf6c3725f77897626c6 (patch)
treeb3a031fcd300e80fdc421bfcb7cced35e879159a /lldb/source/Expression/IRForTarget.cpp
parentd0502c177707282151d69f93d09803de29815be6 (diff)
downloadbcm5719-llvm-951f6ce9032ed4b913a9bbf6c3725f77897626c6.tar.gz
bcm5719-llvm-951f6ce9032ed4b913a9bbf6c3725f77897626c6.zip
Fixed a bug where we left a definition hanging
for a global variable that we had replaced with a reference to a slot in the input array. llvm-svn: 118123
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r--lldb/source/Expression/IRForTarget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp
index fbb2eda0240..d6d0586b3f2 100644
--- a/lldb/source/Expression/IRForTarget.cpp
+++ b/lldb/source/Expression/IRForTarget.cpp
@@ -1103,6 +1103,9 @@ IRForTarget::replaceVariables(Module &M, Function &F)
UnfoldConstant(constant, bit_cast, first_entry_instruction);
else
value->replaceAllUsesWith(bit_cast);
+
+ if (GlobalVariable *var = dyn_cast<GlobalVariable>(value))
+ var->eraseFromParent();
}
if (log)
OpenPOWER on IntegriCloud