[svn r336] Made sure calls within a landing pad area are invokes.

Nested trys still need some consideration.
This commit is contained in:
Christian Kamm
2008-07-03 22:05:45 +02:00
parent 9f0b3fb062
commit 37305fb47e
10 changed files with 163 additions and 105 deletions

View File

@@ -713,7 +713,7 @@ void ThrowStatement::toIR(IRState* p)
//Logger::cout() << "calling: " << *fn << '\n';
LLValue* arg = DtoBitCast(e->getRVal(), fn->getFunctionType()->getParamType(0));
//Logger::cout() << "arg: " << *arg << '\n';
gIR->ir->CreateCall(fn, arg, "");
gIR->CreateCallOrInvoke(fn, arg);
gIR->ir->CreateUnreachable();
// need a block after the throw for now
@@ -781,14 +781,14 @@ static LLValue* call_string_switch_runtime(llvm::GlobalVariable* table, Expressi
}
assert(llval->getType() == fn->getFunctionType()->getParamType(1));
llvm::CallInst* call = gIR->ir->CreateCall2(fn, table, llval, "tmp");
CallOrInvoke* call = gIR->CreateCallOrInvoke2(fn, table, llval, "tmp");
llvm::PAListPtr palist;
palist = palist.addAttr(1, llvm::ParamAttr::ByVal);
palist = palist.addAttr(2, llvm::ParamAttr::ByVal);
call->setParamAttrs(palist);
return call;
return call->get();
}
void SwitchStatement::toIR(IRState* p)