aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-31 20:33:31 +0000
committerChris Lattner <sabre@nondot.org>2003-05-31 20:33:31 +0000
commit567cceea49f66ed7e743853cdd0ba689651f79bb (patch)
tree9b2b7ec85a3e3c6e3b5eab015c850873b059fa9c /lib/Transforms
parent87a09562d57acb195db3023cd85e2b65a3a7322a (diff)
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/FunctionResolution.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/Transforms/IPO/FunctionResolution.cpp b/lib/Transforms/IPO/FunctionResolution.cpp
index 861e810601..75159eaaf7 100644
--- a/lib/Transforms/IPO/FunctionResolution.cpp
+++ b/lib/Transforms/IPO/FunctionResolution.cpp
@@ -188,17 +188,9 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals,
++i;
}
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(U)) {
- if (CPR->use_size() == 1 && isa<ConstantExpr>(CPR->use_back()) &&
- cast<ConstantExpr>(CPR->use_back())->getOpcode() ==
- Instruction::Cast) {
- ConstantExpr *CE = cast<ConstantExpr>(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;