Changeset 1650:40bd4a0d4870 for gen/main.cpp
- Timestamp:
- 05/19/10 06:42:32 (2 years ago)
- Files:
-
- gen/main.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gen/main.cpp
r1645 r1650 149 149 global.params.objfiles = new Array(); 150 150 global.params.ddocfiles = new Array(); 151 151 152 152 global.params.moduleDeps = NULL; 153 153 global.params.moduleDepsFile = NULL; … … 224 224 initFromString(global.params.objname, objectFile); 225 225 initFromString(global.params.objdir, objectDir); 226 226 227 227 initFromString(global.params.docdir, ddocDir); 228 228 initFromString(global.params.docname, ddocFile); 229 229 global.params.doDocComments |= 230 230 global.params.docdir || global.params.docname; 231 231 232 232 #ifdef _DH 233 233 initFromString(global.params.hdrdir, hdrDir); … … 238 238 239 239 initFromString(global.params.moduleDepsFile, moduleDepsFile); 240 if (global.params.moduleDepsFile != NULL) 241 { 242 global.params.moduleDeps = new OutBuffer; 240 if (global.params.moduleDepsFile != NULL) 241 { 242 global.params.moduleDeps = new OutBuffer; 243 243 } 244 244 … … 436 436 437 437 // Allocate target machine. 438 438 439 439 // first initialize llvm 440 440 #define LLVM_TARGET(A) LLVMInitialize##A##TargetInfo(); LLVMInitialize##A##Target(); LLVMInitialize##A##AsmPrinter(); … … 485 485 } 486 486 487 std::auto_ptr<llvm::TargetMachine> target(theTarget->createTargetMachine(triple, FeaturesStr)); 488 assert(target.get() && "Could not allocate target machine!"); 489 gTargetMachine = target.get(); 490 gTargetData = gTargetMachine->getTargetData(); 487 // FIXME 488 //std::auto_ptr<llvm::TargetMachine> target(theTarget->createTargetMachine(triple, FeaturesStr)); 489 //assert(target.get() && "Could not allocate target machine!"); 490 //gTargetMachine = target.get(); 491 492 llvm::TargetMachine* target = theTarget->createTargetMachine(triple, FeaturesStr); 493 gTargetMachine = target; 494 495 gTargetData = target->getTargetData(); 491 496 492 497 // get final data layout … … 904 909 905 910 // write module dependencies to file if requested 906 if (global.params.moduleDepsFile != NULL) 907 { 911 if (global.params.moduleDepsFile != NULL) 912 { 908 913 assert (global.params.moduleDepsFile != NULL); 909 914 910 915 File deps(global.params.moduleDepsFile); 911 OutBuffer* ob = global.params.moduleDeps; 916 OutBuffer* ob = global.params.moduleDeps; 912 917 deps.setbuffer((void*)ob->data, ob->offset); 913 918 deps.write(); … … 945 950 } 946 951 } 947 952 948 953 // internal linking for singleobj 949 954 if (singleObj && llvmModules.size() > 0) … … 952 957 char* name = m->toChars(); 953 958 char* filename = m->objfile->name->str; 954 959 955 960 llvm::Linker linker(name, name, context); 956 961 … … 962 967 delete llvmModules[i]; 963 968 } 964 969 965 970 m->deleteObjFile(); 966 971 writeModule(linker.getModule(), filename); 967 972 global.params.objfiles->push(filename); 968 973 } 969 974 970 975 backend_term(); 971 976 if (global.errors)

