diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-04 16:47:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-04 16:47:43 +0000 |
commit | 08c93a7f2210b464e5abe298a5474b99414615f6 (patch) | |
tree | c29fced92eda76a83b0a1fef1c413cd27085b274 /lib/CodeGen/CodeGenModule.cpp | |
parent | 810dc54e1c091f7ee0167ef6e271e2ea308882e1 (diff) |
Make ReplaceUsesOfNonProtoTypeWithRealFunction verify that a call is *to* the
function of interest, not an operand of it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index b69301ed58..6e8440a177 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -891,8 +891,9 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, for (llvm::Value::use_iterator UI = OldFn->use_begin(), E = OldFn->use_end(); UI != E; ) { // TODO: Do invokes ever occur in C code? If so, we should handle them too. + unsigned OpNo = UI.getOperandNo(); llvm::CallInst *CI = dyn_cast<llvm::CallInst>(*UI++); - if (!CI) continue; + if (!CI || OpNo != 0) continue; // If the return types don't match exactly, and if the call isn't dead, then // we can't transform this call. |