From cdfc940912d56a63b6f12eaa7f3faf79cf74c693 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 1 Nov 2009 01:27:45 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85699 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/BasicBlock.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/VMCore/BasicBlock.cpp') diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index c609ef85eb..23d0557dc7 100644 --- a/lib/VMCore/BasicBlock.cpp +++ b/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(use_back()); - BA->replaceAllUsesWith(BlockAddress::get(BA->getFunction(), 0)); + BA->replaceAllUsesWith(ConstantExpr::getIntToPtr(Replacement, + BA->getType())); BA->destroyConstant(); } } -- cgit v1.2.3