diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-31 20:44:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-31 20:44:46 +0000 |
commit | 40c4959e9fe77b8379e23f850a191bbacdfe6c03 (patch) | |
tree | a9b1dc35a3fbb9f35b460acd12336b871ba2db5e /lib/Transforms/IPO | |
parent | 567cceea49f66ed7e743853cdd0ba689651f79bb (diff) | |
download | external_llvm-40c4959e9fe77b8379e23f850a191bbacdfe6c03.zip external_llvm-40c4959e9fe77b8379e23f850a191bbacdfe6c03.tar.gz external_llvm-40c4959e9fe77b8379e23f850a191bbacdfe6c03.tar.bz2 |
Simplify funcresolve a bit more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/FunctionResolution.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/IPO/FunctionResolution.cpp b/lib/Transforms/IPO/FunctionResolution.cpp index 75159ea..5b2e39f 100644 --- a/lib/Transforms/IPO/FunctionResolution.cpp +++ b/lib/Transforms/IPO/FunctionResolution.cpp @@ -183,19 +183,19 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals, Changed = true; ++NumResolved; } else { - std::cerr << "Couldn't cleanup this function call, must be an" - << " argument or something!" << CI; ++i; } - } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(U)) { - 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; } } + + // If there are any more uses that we could not resolve, force them to use + // a casted pointer now. + if (!Old->use_empty()) { + Constant *NewCPR = ConstantPointerRef::get(Concrete); + Old->replaceAllUsesWith(ConstantExpr::getCast(NewCPR, Old->getType())); + } } return Changed; } |