[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
Yuri
yuri at rawbw.com
Sun Jun 17 13:03:12 PDT 2012
BasicBlock::~BasicBlock() has the line:
BA->replaceAllUsesWith(ConstantExpr::getIntToPtr(Replacement,
BA->getType()));
It replaces all uses with: Constant *Replacement =
ConstantInt::get(llvm::Type::getInt32Ty(getContext()), 1);
When it is called on link source module, BasicBlocks there are destroyed
but their uses are in the link destination module.
Value::replaceAllUsesWith should have an assert checking if the use is
in the same module as the current value.
Yuri
More information about the llvm-dev
mailing list