Mercurial > projects > ldc
diff gen/toir.c @ 11:d3ee9efe20e2 trunk
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
* Now 50/51 tests compile.
* Added a simple runalltests.d scripts that should be run with 'gdmd -run runalltests.d' - LLVMDC will not compile it yet.
author | lindquist |
---|---|
date | Tue, 02 Oct 2007 05:10:18 +0200 |
parents | dafae18f9c08 |
children | 0e86428ee567 |
line wrap: on
line diff
--- a/gen/toir.c Mon Oct 01 23:32:29 2007 +0200 +++ b/gen/toir.c Tue Oct 02 05:10:18 2007 +0200 @@ -954,6 +954,8 @@ // set calling convention if ((fn->funcdecl && (fn->funcdecl->llvmInternal != LLVMintrinsic)) || delegateCall) call->setCallingConv(LLVM_DtoCallingConv(dlink)); + else if (fn->callconv != (unsigned)-1) + call->setCallingConv(fn->callconv); delete fn; return e; @@ -1253,7 +1255,7 @@ funcval = LLVM_DtoGEP(funcval, zero, vtblidx, "tmp", p->scopebb()); funcval = new llvm::LoadInst(funcval,"tmp",p->scopebb()); assert(funcval->getType() == fdecl->llvmValue->getType()); - //funcval = new llvm::BitCastInst(funcval, fdecl->llvmValue->getType(), "tmp", p->scopebb()); + e->callconv = LLVM_DtoCallingConv(fdecl->linkage); } e->val = funcval; e->type = elem::VAL;