Make ReplaceUsesOfNonProtoTypeWithRealFunction verify that a call is *to* the

function of interest, not an operand of it.

llvm-svn: 72869
This commit is contained in:
Chris Lattner 2009-06-04 16:47:43 +00:00
parent 5e4702db61
commit 0261e5c960
1 changed files with 2 additions and 1 deletions

View File

@ -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.