diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-06 02:25:12 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-06 02:25:12 +0000 |
commit | 6f2e37429af186069cb93a30b436cb567293f047 (patch) | |
tree | 303923d9385aa5d5a4e3778f332407bca4a483b5 /llvm/lib/Transforms/Utils | |
parent | 29883866a40279a1e8328b06f0b443493d06a95b (diff) | |
download | bcm5719-llvm-6f2e37429af186069cb93a30b436cb567293f047.tar.gz bcm5719-llvm-6f2e37429af186069cb93a30b436cb567293f047.zip |
ValueMapper: Fix delayed blockaddress handling after r265273
r265273 added Mapper::mapBlockAddress, which delays mapping a
blockaddress value until the function has a body. The condition was
backwards, and should be checking Function::empty instead of
GlobalValue::isDeclaration.
llvm-svn: 265508
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()); |