mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
Fixed problem with invoking intrinsics, which llvm doesn't allow.
This commit is contained in:
@@ -215,6 +215,13 @@ CallOrInvoke* IRState::CreateCallOrInvoke(LLValue* Callee, InputIterator ArgBegi
|
||||
llvm::BasicBlock* pad;
|
||||
if(pad = func()->landingPad.get())
|
||||
{
|
||||
// intrinsics don't support invoking
|
||||
LLFunction* funcval = llvm::dyn_cast<LLFunction>(Callee);
|
||||
if (funcval && funcval->isIntrinsic())
|
||||
{
|
||||
return new CallOrInvoke_Call(ir->CreateCall(Callee, ArgBegin, ArgEnd, Name));
|
||||
}
|
||||
|
||||
llvm::BasicBlock* postinvoke = llvm::BasicBlock::Create("postinvoke", topfunc(), scopeend());
|
||||
llvm::InvokeInst* invoke = ir->CreateInvoke(Callee, postinvoke, pad, ArgBegin, ArgEnd, Name);
|
||||
scope() = IRScope(postinvoke, scopeend());
|
||||
|
||||
Reference in New Issue
Block a user