summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-04 16:47:43 +0000
committerChris Lattner <sabre@nondot.org>2009-06-04 16:47:43 +0000
commit0261e5c960730d894d83d6b3f16e4580189bb3ee (patch)
tree0035562bcac4564466eb52f684a9d7a6a9287bee /clang/lib/CodeGen/CodeGenModule.cpp
parent5e4702db61362b852840b83b66921af61d874061 (diff)
downloadbcm5719-llvm-0261e5c960730d894d83d6b3f16e4580189bb3ee.tar.gz
bcm5719-llvm-0261e5c960730d894d83d6b3f16e4580189bb3ee.zip
Make ReplaceUsesOfNonProtoTypeWithRealFunction verify that a call is *to* the
function of interest, not an operand of it. llvm-svn: 72869
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index b69301ed589..6e8440a1773 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud