Mercurial > projects > ldc
comparison gen/toobj.cpp @ 336:aaade6ded589 trunk
[svn r357] Merged DMD 1.033
author | lindquist |
---|---|
date | Sat, 12 Jul 2008 19:38:31 +0200 |
parents | c542d12017e5 |
children | 4d7495038ae8 |
comparison
equal
deleted
inserted
replaced
335:17b844102023 | 336:aaade6ded589 |
---|---|
51 // in gen/optimize.cpp | 51 // in gen/optimize.cpp |
52 void llvmdc_optimize_module(llvm::Module* m, char lvl, bool doinline); | 52 void llvmdc_optimize_module(llvm::Module* m, char lvl, bool doinline); |
53 | 53 |
54 ////////////////////////////////////////////////////////////////////////////////////////// | 54 ////////////////////////////////////////////////////////////////////////////////////////// |
55 | 55 |
56 void Module::genobjfile() | 56 void Module::genobjfile(int multiobj) |
57 { | 57 { |
58 Logger::cout() << "Generating module: " << (md ? md->toChars() : toChars()) << '\n'; | 58 Logger::cout() << "Generating module: " << (md ? md->toChars() : toChars()) << '\n'; |
59 LOG_SCOPE; | 59 LOG_SCOPE; |
60 | 60 |
61 // start by deleting the old object file | 61 // start by deleting the old object file |
118 | 118 |
119 // process module members | 119 // process module members |
120 for (int k=0; k < members->dim; k++) { | 120 for (int k=0; k < members->dim; k++) { |
121 Dsymbol* dsym = (Dsymbol*)(members->data[k]); | 121 Dsymbol* dsym = (Dsymbol*)(members->data[k]); |
122 assert(dsym); | 122 assert(dsym); |
123 dsym->toObjFile(); | 123 dsym->toObjFile(multiobj); |
124 } | 124 } |
125 | 125 |
126 // main driver loop | 126 // main driver loop |
127 DtoEmptyAllLists(); | 127 DtoEmptyAllLists(); |
128 // generate ModuleInfo | 128 // generate ModuleInfo |
548 llvm::GlobalVariable* appendVar = new llvm::GlobalVariable(appendArrTy, true, llvm::GlobalValue::AppendingLinkage, appendInit, appendName, gIR->module); | 548 llvm::GlobalVariable* appendVar = new llvm::GlobalVariable(appendArrTy, true, llvm::GlobalValue::AppendingLinkage, appendInit, appendName, gIR->module); |
549 } | 549 } |
550 | 550 |
551 /* ================================================================== */ | 551 /* ================================================================== */ |
552 | 552 |
553 void Dsymbol::toObjFile() | 553 void Dsymbol::toObjFile(int multiobj) |
554 { | 554 { |
555 Logger::println("Ignoring Dsymbol::toObjFile for %s", toChars()); | 555 Logger::println("Ignoring Dsymbol::toObjFile for %s", toChars()); |
556 } | 556 } |
557 | 557 |
558 /* ================================================================== */ | 558 /* ================================================================== */ |
562 Logger::println("Ignoring Declaration::toObjFile for %s", toChars()); | 562 Logger::println("Ignoring Declaration::toObjFile for %s", toChars()); |
563 } | 563 } |
564 | 564 |
565 /* ================================================================== */ | 565 /* ================================================================== */ |
566 | 566 |
567 void InterfaceDeclaration::toObjFile() | 567 void InterfaceDeclaration::toObjFile(int multiobj) |
568 { | 568 { |
569 //Logger::println("Ignoring InterfaceDeclaration::toObjFile for %s", toChars()); | 569 //Logger::println("Ignoring InterfaceDeclaration::toObjFile for %s", toChars()); |
570 gIR->resolveList.push_back(this); | 570 gIR->resolveList.push_back(this); |
571 } | 571 } |
572 | 572 |
573 /* ================================================================== */ | 573 /* ================================================================== */ |
574 | 574 |
575 void StructDeclaration::toObjFile() | 575 void StructDeclaration::toObjFile(int multiobj) |
576 { | 576 { |
577 gIR->resolveList.push_back(this); | 577 gIR->resolveList.push_back(this); |
578 } | 578 } |
579 | 579 |
580 /* ================================================================== */ | 580 /* ================================================================== */ |
581 | 581 |
582 void ClassDeclaration::toObjFile() | 582 void ClassDeclaration::toObjFile(int multiobj) |
583 { | 583 { |
584 gIR->resolveList.push_back(this); | 584 gIR->resolveList.push_back(this); |
585 } | 585 } |
586 | 586 |
587 /****************************************** | 587 /****************************************** |
594 return ~0; | 594 return ~0; |
595 } | 595 } |
596 | 596 |
597 /* ================================================================== */ | 597 /* ================================================================== */ |
598 | 598 |
599 void VarDeclaration::toObjFile() | 599 void VarDeclaration::toObjFile(int multiobj) |
600 { | 600 { |
601 Logger::print("VarDeclaration::toObjFile(): %s | %s\n", toChars(), type->toChars()); | 601 Logger::print("VarDeclaration::toObjFile(): %s | %s\n", toChars(), type->toChars()); |
602 LOG_SCOPE; | 602 LOG_SCOPE; |
603 | 603 |
604 if (aliassym) | 604 if (aliassym) |
605 { | 605 { |
606 Logger::println("alias sym"); | 606 Logger::println("alias sym"); |
607 toAlias()->toObjFile(); | 607 toAlias()->toObjFile(multiobj); |
608 return; | 608 return; |
609 } | 609 } |
610 | 610 |
611 // global variable or magic | 611 // global variable or magic |
612 if (isDataseg()) | 612 if (isDataseg()) |
667 Logger::println("VarDeclaration::toObjFile is done"); | 667 Logger::println("VarDeclaration::toObjFile is done"); |
668 } | 668 } |
669 | 669 |
670 /* ================================================================== */ | 670 /* ================================================================== */ |
671 | 671 |
672 void TypedefDeclaration::toObjFile() | 672 void TypedefDeclaration::toObjFile(int multiobj) |
673 { | 673 { |
674 static int tdi = 0; | 674 static int tdi = 0; |
675 Logger::print("TypedefDeclaration::toObjFile(%d): %s\n", tdi++, toChars()); | 675 Logger::print("TypedefDeclaration::toObjFile(%d): %s\n", tdi++, toChars()); |
676 LOG_SCOPE; | 676 LOG_SCOPE; |
677 | 677 |
679 DtoTypeInfoOf(type, false); | 679 DtoTypeInfoOf(type, false); |
680 } | 680 } |
681 | 681 |
682 /* ================================================================== */ | 682 /* ================================================================== */ |
683 | 683 |
684 void EnumDeclaration::toObjFile() | 684 void EnumDeclaration::toObjFile(int multiobj) |
685 { | 685 { |
686 Logger::println("Ignoring EnumDeclaration::toObjFile for %s", toChars()); | 686 Logger::println("Ignoring EnumDeclaration::toObjFile for %s", toChars()); |
687 } | 687 } |
688 | 688 |
689 /* ================================================================== */ | 689 /* ================================================================== */ |
690 | 690 |
691 void FuncDeclaration::toObjFile() | 691 void FuncDeclaration::toObjFile(int multiobj) |
692 { | 692 { |
693 gIR->resolveList.push_back(this); | 693 gIR->resolveList.push_back(this); |
694 } | 694 } |