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
This commit is contained in:
Sean Callanan 2010-11-02 23:51:17 +00:00
parent d0502c1777
commit 951f6ce903
1 changed files with 3 additions and 0 deletions

View File

@ -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)