comparison 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
comparison
equal deleted inserted replaced
10:c0f2c47e5034 11:d3ee9efe20e2
952 e->val = call; 952 e->val = call;
953 953
954 // set calling convention 954 // set calling convention
955 if ((fn->funcdecl && (fn->funcdecl->llvmInternal != LLVMintrinsic)) || delegateCall) 955 if ((fn->funcdecl && (fn->funcdecl->llvmInternal != LLVMintrinsic)) || delegateCall)
956 call->setCallingConv(LLVM_DtoCallingConv(dlink)); 956 call->setCallingConv(LLVM_DtoCallingConv(dlink));
957 else if (fn->callconv != (unsigned)-1)
958 call->setCallingConv(fn->callconv);
957 959
958 delete fn; 960 delete fn;
959 return e; 961 return e;
960 } 962 }
961 963
1251 funcval = LLVM_DtoGEP(e->arg, zero, zero, "tmp", p->scopebb()); 1253 funcval = LLVM_DtoGEP(e->arg, zero, zero, "tmp", p->scopebb());
1252 funcval = new llvm::LoadInst(funcval,"tmp",p->scopebb()); 1254 funcval = new llvm::LoadInst(funcval,"tmp",p->scopebb());
1253 funcval = LLVM_DtoGEP(funcval, zero, vtblidx, "tmp", p->scopebb()); 1255 funcval = LLVM_DtoGEP(funcval, zero, vtblidx, "tmp", p->scopebb());
1254 funcval = new llvm::LoadInst(funcval,"tmp",p->scopebb()); 1256 funcval = new llvm::LoadInst(funcval,"tmp",p->scopebb());
1255 assert(funcval->getType() == fdecl->llvmValue->getType()); 1257 assert(funcval->getType() == fdecl->llvmValue->getType());
1256 //funcval = new llvm::BitCastInst(funcval, fdecl->llvmValue->getType(), "tmp", p->scopebb()); 1258 e->callconv = LLVM_DtoCallingConv(fdecl->linkage);
1257 } 1259 }
1258 e->val = funcval; 1260 e->val = funcval;
1259 e->type = elem::VAL; 1261 e->type = elem::VAL;
1260 } 1262 }
1261 else { 1263 else {