va_end fix

llvm-svn: 22262
This commit is contained in:
Andrew Lenharth 2005-06-19 14:04:55 +00:00
parent 237e6afde7
commit 717f1610f0
2 changed files with 2 additions and 0 deletions

View File

@ -785,6 +785,7 @@ static PATypeHolder HandleUpRefs(const Type *ty) {
while (!F->use_empty()) {
CallInst* CI = cast<CallInst>(F->use_back());
AllocaInst* bar = new AllocaInst(ArgTy, 0, "vaend.fix.1", CI);
new StoreInst(CI->getOperand(1), bar, CI);
new CallInst(NF, bar, "", CI);
CI->getParent()->getInstList().erase(CI);
}

View File

@ -209,6 +209,7 @@ static ModuleProvider* CheckVarargs(ModuleProvider* MP) {
for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;)
if (CallInst* CI = dyn_cast<CallInst>(*I++)) {
AllocaInst* bar = new AllocaInst(ArgTy, 0, "vaend.fix.1", CI);
new StoreInst(CI->getOperand(1), bar, CI);
new CallInst(NF, bar, "", CI);
CI->getParent()->getInstList().erase(CI);
}