forked from OSchip/llvm-project
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:
parent
d0502c1777
commit
951f6ce903
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue