we are not supposed to create an improper callsite using a CallInstr; leave a fixme mentioning the simplification when CallSite can clone itself

llvm-svn: 109575
This commit is contained in:
Gabor Greif 2010-07-28 09:19:33 +00:00
parent 9e40956aea
commit 79ac9ed7ac
1 changed files with 1 additions and 0 deletions

View File

@ -1329,6 +1329,7 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
// TODO: Do invokes ever occur in C code? If so, we should handle them too. // TODO: Do invokes ever occur in C code? If so, we should handle them too.
llvm::Value::use_iterator I = UI++; // Increment before the CI is erased. llvm::Value::use_iterator I = UI++; // Increment before the CI is erased.
llvm::CallInst *CI = dyn_cast<llvm::CallInst>(*I); llvm::CallInst *CI = dyn_cast<llvm::CallInst>(*I);
if (!CI) continue; // FIXME: when we allow Invoke, just do CallSite CS(*I)
llvm::CallSite CS(CI); llvm::CallSite CS(CI);
if (!CI || !CS.isCallee(I)) continue; if (!CI || !CS.isCallee(I)) continue;