[cfe-commits] r72869 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Thu Jun 4 09:47:44 PDT 2009


Author: lattner
Date: Thu Jun  4 11:47:43 2009
New Revision: 72869

URL: http://llvm.org/viewvc/llvm-project?rev=72869&view=rev
Log:
Make ReplaceUsesOfNonProtoTypeWithRealFunction verify that a call is *to* the
function of interest, not an operand of it.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=72869&r1=72868&r2=72869&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Jun  4 11:47:43 2009
@@ -891,8 +891,9 @@
   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.





More information about the cfe-commits mailing list