Mercurial > projects > ldc
changeset 447:f7259fa1349c
Fixed problem with invoking intrinsics, which llvm doesn't allow.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Fri, 01 Aug 2008 19:54:31 +0200 |
parents | 7a67dedbf933 |
children | 7f037b2ab84e 56265fa07c7d |
files | gen/irstate.h |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/irstate.h Fri Aug 01 18:07:33 2008 +0200 +++ b/gen/irstate.h Fri Aug 01 19:54:31 2008 +0200 @@ -215,6 +215,13 @@ 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());