mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +00:00
adjust a couple xforms to work with null bb's in BlockAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85680 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -113,8 +113,13 @@ Value *llvm::MapValue(const Value *V, ValueMapTy &VM) {
|
||||
|
||||
if (BlockAddress *BA = dyn_cast<BlockAddress>(C)) {
|
||||
Function *F = cast<Function>(MapValue(BA->getFunction(), VM));
|
||||
BasicBlock *BB = cast_or_null<BasicBlock>(MapValue(BA->getBasicBlock(),VM));
|
||||
return VM[V] = BlockAddress::get(F, BB ? BB : BA->getBasicBlock());
|
||||
BasicBlock *BB = 0;
|
||||
if (BA->getBasicBlock()) {
|
||||
BB = cast_or_null<BasicBlock>(MapValue(BA->getBasicBlock(),VM));
|
||||
BB = BB ? BB : BA->getBasicBlock();
|
||||
}
|
||||
|
||||
return VM[V] = BlockAddress::get(F, BB);
|
||||
}
|
||||
|
||||
llvm_unreachable("Unknown type of constant!");
|
||||
|
Reference in New Issue
Block a user