summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/BasicBlock.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-01 01:27:45 +0000
committerChris Lattner <sabre@nondot.org>2009-11-01 01:27:45 +0000
commitaa99c94e2a75e86381bcc45de61c11725a1484d6 (patch)
tree5ebc881e76d6c5d15bc2a8240caa9c274da1a3ce /llvm/lib/VMCore/BasicBlock.cpp
parent6f29ad917051349b99d566ddf57add7c60489094 (diff)
downloadbcm5719-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/VMCore/BasicBlock.cpp')
-rw-r--r--llvm/lib/VMCore/BasicBlock.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp
index c609ef85ebd..23d0557dc74 100644
--- a/llvm/lib/VMCore/BasicBlock.cpp
+++ b/llvm/lib/VMCore/BasicBlock.cpp
@@ -63,13 +63,15 @@ BasicBlock::~BasicBlock() {
// hanging off the block, or an undefined use of the block (source code
// expecting the address of a label to keep the block alive even though there
// is no indirect branch). Handle these cases by zapping the BlockAddress
- // nodes, replacing them with BlockAddress(F, NULL). There are no other
- // possible uses at this point.
+ // nodes. There are no other possible uses at this point.
if (hasAddressTaken()) {
assert(!use_empty() && "There should be at least one blockaddress!");
+ Constant *Replacement =
+ ConstantInt::get(llvm::Type::getInt32Ty(getContext()), 1);
while (!use_empty()) {
BlockAddress *BA = cast<BlockAddress>(use_back());
- BA->replaceAllUsesWith(BlockAddress::get(BA->getFunction(), 0));
+ BA->replaceAllUsesWith(ConstantExpr::getIntToPtr(Replacement,
+ BA->getType()));
BA->destroyConstant();
}
}
OpenPOWER on IntegriCloud