diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-01 01:27:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-01 01:27:45 +0000 |
commit | aa99c94e2a75e86381bcc45de61c11725a1484d6 (patch) | |
tree | 5ebc881e76d6c5d15bc2a8240caa9c274da1a3ce /llvm/lib/Transforms | |
parent | 6f29ad917051349b99d566ddf57add7c60489094 (diff) | |
download | bcm5719-llvm-aa99c94e2a75e86381bcc45de61c11725a1484d6.tar.gz bcm5719-llvm-aa99c94e2a75e86381bcc45de61c11725a1484d6.zip |
Revert 85678/85680. The decision is to stay with the current form of
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it
for simplicity.
llvm-svn: 85699
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 9 |
2 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 94951002b46..49e9683a556 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -2345,7 +2345,8 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal, Value *Val = getVal(Values, IBI->getAddress())->stripPointerCasts(); if (BlockAddress *BA = dyn_cast<BlockAddress>(Val)) NewBB = BA->getBasicBlock(); - if (NewBB == 0) return false; // Cannot determine. + else + return false; // Cannot determine. } else if (ReturnInst *RI = dyn_cast<ReturnInst>(CurInst)) { if (RI->getNumOperands()) RetVal = getVal(Values, RI->getOperand(0)); diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 7929eb9ac2b..39331d78169 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -113,13 +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 = 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); + 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!"); |