comparison gen/toobj.cpp @ 1364:46f6365a50d7

Added IrTypeFunction and IrTypeDelegate and eliminated IrDType. This means the Type::ir field can be removed. It's the final part needed for the move to a slightly more sane type system. Now the whole thing just needs to be cleaned up :P Added -v-cg switch, which right now just prints "codegen: module.name (module/name.d)" to stdout, this can really help figuring out where, in some complex build command, things go wrong.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sat, 16 May 2009 18:19:52 +0200
parents 681dd955c53b
children d430a41fbb45
comparison
equal deleted inserted replaced
1363:b7c8506e1eed 1364:46f6365a50d7
52 #include "gen/llvm-version.h" 52 #include "gen/llvm-version.h"
53 #include "gen/programs.h" 53 #include "gen/programs.h"
54 54
55 #include "ir/irvar.h" 55 #include "ir/irvar.h"
56 #include "ir/irmodule.h" 56 #include "ir/irmodule.h"
57 #include "ir/irtype.h"
57 58
58 ////////////////////////////////////////////////////////////////////////////////////////// 59 //////////////////////////////////////////////////////////////////////////////////////////
59 60
60 static llvm::cl::opt<bool> noVerify("noverify", 61 static llvm::cl::opt<bool> noVerify("noverify",
61 llvm::cl::desc("Do not run the validation pass before writing bitcode"), 62 llvm::cl::desc("Do not run the validation pass before writing bitcode"),
78 } 79 }
79 80
80 Logger::println("Generating module: %s\n", (md ? md->toChars() : toChars())); 81 Logger::println("Generating module: %s\n", (md ? md->toChars() : toChars()));
81 LOG_SCOPE; 82 LOG_SCOPE;
82 83
83 //printf("codegen: %s\n", srcfile->toChars()); 84 if (global.params.verbose_cg)
85 printf("codegen: %s (%s)\n", toPrettyChars(), srcfile->toChars());
84 86
85 assert(!global.errors); 87 assert(!global.errors);
86 88
87 // name the module 89 // name the module
88 std::string mname(toChars()); 90 std::string mname(toChars());
607 error("object.d ModuleInfo class is incorrect"); 609 error("object.d ModuleInfo class is incorrect");
608 fatal(); 610 fatal();
609 } 611 }
610 612
611 // moduleinfo llvm struct type 613 // moduleinfo llvm struct type
612 const llvm::StructType* moduleinfoTy = isaStruct(moduleinfo->type->ir.type->get()); 614 const llvm::StructType* moduleinfoTy = isaStruct(moduleinfo->type->irtype->getPA());
613 // classinfo llvm struct type 615 // classinfo llvm struct type
614 const llvm::StructType* classinfoTy = isaStruct(ClassDeclaration::classinfo->type->ir.type->get()); 616 const llvm::StructType* classinfoTy = isaStruct(ClassDeclaration::classinfo->type->irtype->getPA());
615 617
616 // initializer vector 618 // initializer vector
617 std::vector<LLConstant*> initVec; 619 std::vector<LLConstant*> initVec;
618 LLConstant* c = 0; 620 LLConstant* c = 0;
619 621