diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-10-29 01:21:20 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-10-29 01:21:20 +0000 |
| commit | ee8b951e73a9580ada11725ccd2e4f49e758b34f (patch) | |
| tree | 09cde592fd25f78f27a784961ca8038ed2aeb2f8 /llvm/lib/Transforms/Utils/ValueMapper.cpp | |
| parent | 29fb551a36dda8f60293908a63f100dd2561f126 (diff) | |
| download | llvm-ee8b951e73a9580ada11725ccd2e4f49e758b34f.zip llvm-ee8b951e73a9580ada11725ccd2e4f49e758b34f.tar.gz llvm-ee8b951e73a9580ada11725ccd2e4f49e758b34f.tar.bz2 | |
teach various passes about blockaddress. We no longer
crash on any clang tests.
llvm-svn: 85465
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 21126c9..39331d7 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -113,8 +113,8 @@ 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<BasicBlock>(MapValue(BA->getBasicBlock(), VM)); - return VM[V] = BlockAddress::get(F, BB); + BasicBlock *BB = cast_or_null<BasicBlock>(MapValue(BA->getBasicBlock(),VM)); + return VM[V] = BlockAddress::get(F, BB ? BB : BA->getBasicBlock()); } llvm_unreachable("Unknown type of constant!"); |
