From 5ef98de61c81b75e0f6cdae6c29fa1479d48b354 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 llvm-svn: 6479 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/llvm/lib/Transforms/IPO/FunctionResolution.cpp b/llvm/lib/Transforms/IPO/FunctionResolution.cpp index 861e8106014c..75159eaaf741 100644 --- a/llvm/lib/Transforms/IPO/FunctionResolution.cpp +++ b/llvm/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;