comparison gen/toobj.cpp @ 933:d3a6f1a96731

Replace assertion with errormessage for unsupported calling conventions. like Pascal. See dstress/run/e/extern_10_A.d
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 04 Feb 2009 00:04:09 +0100
parents 545f54041d91
children 2ebac4750adb
comparison
equal deleted inserted replaced
932:5e3bb0c3ea8b 933:d3a6f1a96731
415 415
416 std::vector<const LLType*> argsTy; 416 std::vector<const LLType*> argsTy;
417 const llvm::FunctionType* fnTy = llvm::FunctionType::get(LLType::VoidTy,argsTy,false); 417 const llvm::FunctionType* fnTy = llvm::FunctionType::get(LLType::VoidTy,argsTy,false);
418 assert(gIR->module->getFunction(name) == NULL); 418 assert(gIR->module->getFunction(name) == NULL);
419 llvm::Function* fn = llvm::Function::Create(fnTy, llvm::GlobalValue::InternalLinkage, name, gIR->module); 419 llvm::Function* fn = llvm::Function::Create(fnTy, llvm::GlobalValue::InternalLinkage, name, gIR->module);
420 fn->setCallingConv(DtoCallingConv(LINKd)); 420 fn->setCallingConv(DtoCallingConv(0, LINKd));
421 421
422 llvm::BasicBlock* bb = llvm::BasicBlock::Create("entry", fn); 422 llvm::BasicBlock* bb = llvm::BasicBlock::Create("entry", fn);
423 IRBuilder<> builder(bb); 423 IRBuilder<> builder(bb);
424 424
425 // debug info 425 // debug info
430 } 430 }
431 431
432 for (size_t i=0; i<n; i++) { 432 for (size_t i=0; i<n; i++) {
433 llvm::Function* f = gIR->ctors[i]->ir.irFunc->func; 433 llvm::Function* f = gIR->ctors[i]->ir.irFunc->func;
434 llvm::CallInst* call = builder.CreateCall(f,""); 434 llvm::CallInst* call = builder.CreateCall(f,"");
435 call->setCallingConv(DtoCallingConv(LINKd)); 435 call->setCallingConv(DtoCallingConv(0, LINKd));
436 } 436 }
437 437
438 // debug info end 438 // debug info end
439 if(global.params.symdebug) 439 if(global.params.symdebug)
440 builder.CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), DBG_CAST(subprog)); 440 builder.CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), DBG_CAST(subprog));
460 460
461 std::vector<const LLType*> argsTy; 461 std::vector<const LLType*> argsTy;
462 const llvm::FunctionType* fnTy = llvm::FunctionType::get(LLType::VoidTy,argsTy,false); 462 const llvm::FunctionType* fnTy = llvm::FunctionType::get(LLType::VoidTy,argsTy,false);
463 assert(gIR->module->getFunction(name) == NULL); 463 assert(gIR->module->getFunction(name) == NULL);
464 llvm::Function* fn = llvm::Function::Create(fnTy, llvm::GlobalValue::InternalLinkage, name, gIR->module); 464 llvm::Function* fn = llvm::Function::Create(fnTy, llvm::GlobalValue::InternalLinkage, name, gIR->module);
465 fn->setCallingConv(DtoCallingConv(LINKd)); 465 fn->setCallingConv(DtoCallingConv(0, LINKd));
466 466
467 llvm::BasicBlock* bb = llvm::BasicBlock::Create("entry", fn); 467 llvm::BasicBlock* bb = llvm::BasicBlock::Create("entry", fn);
468 IRBuilder<> builder(bb); 468 IRBuilder<> builder(bb);
469 469
470 // debug info 470 // debug info
475 } 475 }
476 476
477 for (size_t i=0; i<n; i++) { 477 for (size_t i=0; i<n; i++) {
478 llvm::Function* f = gIR->dtors[i]->ir.irFunc->func; 478 llvm::Function* f = gIR->dtors[i]->ir.irFunc->func;
479 llvm::CallInst* call = builder.CreateCall(f,""); 479 llvm::CallInst* call = builder.CreateCall(f,"");
480 call->setCallingConv(DtoCallingConv(LINKd)); 480 call->setCallingConv(DtoCallingConv(0, LINKd));
481 } 481 }
482 482
483 // debug info end 483 // debug info end
484 if(global.params.symdebug) 484 if(global.params.symdebug)
485 builder.CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), DBG_CAST(subprog)); 485 builder.CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), DBG_CAST(subprog));
505 505
506 std::vector<const LLType*> argsTy; 506 std::vector<const LLType*> argsTy;
507 const llvm::FunctionType* fnTy = llvm::FunctionType::get(LLType::VoidTy,argsTy,false); 507 const llvm::FunctionType* fnTy = llvm::FunctionType::get(LLType::VoidTy,argsTy,false);
508 assert(gIR->module->getFunction(name) == NULL); 508 assert(gIR->module->getFunction(name) == NULL);
509 llvm::Function* fn = llvm::Function::Create(fnTy, llvm::GlobalValue::InternalLinkage, name, gIR->module); 509 llvm::Function* fn = llvm::Function::Create(fnTy, llvm::GlobalValue::InternalLinkage, name, gIR->module);
510 fn->setCallingConv(DtoCallingConv(LINKd)); 510 fn->setCallingConv(DtoCallingConv(0, LINKd));
511 511
512 llvm::BasicBlock* bb = llvm::BasicBlock::Create("entry", fn); 512 llvm::BasicBlock* bb = llvm::BasicBlock::Create("entry", fn);
513 IRBuilder<> builder(bb); 513 IRBuilder<> builder(bb);
514 514
515 // debug info 515 // debug info
520 } 520 }
521 521
522 for (size_t i=0; i<n; i++) { 522 for (size_t i=0; i<n; i++) {
523 llvm::Function* f = gIR->unitTests[i]->ir.irFunc->func; 523 llvm::Function* f = gIR->unitTests[i]->ir.irFunc->func;
524 llvm::CallInst* call = builder.CreateCall(f,""); 524 llvm::CallInst* call = builder.CreateCall(f,"");
525 call->setCallingConv(DtoCallingConv(LINKd)); 525 call->setCallingConv(DtoCallingConv(0, LINKd));
526 } 526 }
527 527
528 // debug info end 528 // debug info end
529 if(global.params.symdebug) 529 if(global.params.symdebug)
530 builder.CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), DBG_CAST(subprog)); 530 builder.CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), DBG_CAST(subprog));