diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index c6285de4add..0c2954fdd32 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -383,11 +383,11 @@ Value *Mapper::mapBlockAddress(const BlockAddress &BA) { // dummy basic block for now, and replace it once we've materialized all // the initializers. BasicBlock *BB; - if (F->isDeclaration()) { - BB = cast_or_null<BasicBlock>(mapValue(BA.getBasicBlock())); - } else { + if (F->empty()) { DelayedBBs.push_back(DelayedBasicBlock(BA)); BB = DelayedBBs.back().TempBB.get(); + } else { + BB = cast_or_null<BasicBlock>(mapValue(BA.getBasicBlock())); } return VM[&BA] = BlockAddress::get(F, BB ? BB : BA.getBasicBlock()); |