forked from OSchip/llvm-project
Fix bug: FunctionResolve/2003-05-31-FuncPointerResolve.ll
llvm-svn: 6479
This commit is contained in:
parent
9c6e99cae6
commit
5ef98de61c
|
@ -188,17 +188,9 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals,
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(U)) {
|
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(U)) {
|
||||||
if (CPR->use_size() == 1 && isa<ConstantExpr>(CPR->use_back()) &&
|
Constant *NewCPR = ConstantPointerRef::get(Concrete);
|
||||||
cast<ConstantExpr>(CPR->use_back())->getOpcode() ==
|
CPR->replaceAllUsesWith(ConstantExpr::getCast(NewCPR,CPR->getType()));
|
||||||
Instruction::Cast) {
|
CPR->destroyConstant();
|
||||||
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;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Cannot convert use of function: " << U << "\n";
|
std::cerr << "Cannot convert use of function: " << U << "\n";
|
||||||
++i;
|
++i;
|
||||||
|
|
Loading…
Reference in New Issue