From 567cceea49f66ed7e743853cdd0ba689651f79bb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 31 May 2003 20:33:31 +0000 Subject: [PATCH] Fix bug: FunctionResolve/2003-05-31-FuncPointerResolve.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6479 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/FunctionResolution.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/Transforms/IPO/FunctionResolution.cpp b/lib/Transforms/IPO/FunctionResolution.cpp index 861e8106014..75159eaaf74 100644 --- a/lib/Transforms/IPO/FunctionResolution.cpp +++ b/lib/Transforms/IPO/FunctionResolution.cpp @@ -188,17 +188,9 @@ static bool ResolveFunctions(Module &M, std::vector &Globals, ++i; } } else if (ConstantPointerRef *CPR = dyn_cast(U)) { - if (CPR->use_size() == 1 && isa(CPR->use_back()) && - cast(CPR->use_back())->getOpcode() == - Instruction::Cast) { - ConstantExpr *CE = cast(CPR->use_back()); - Constant *NewCPR = ConstantPointerRef::get(Concrete); - CE->replaceAllUsesWith(ConstantExpr::getCast(NewCPR,CE->getType())); - CPR->destroyConstant(); - } else { - std::cerr << "Cannot convert use of function: " << CPR << "\n"; - ++i; - } + Constant *NewCPR = ConstantPointerRef::get(Concrete); + CPR->replaceAllUsesWith(ConstantExpr::getCast(NewCPR,CPR->getType())); + CPR->destroyConstant(); } else { std::cerr << "Cannot convert use of function: " << U << "\n"; ++i;