comparison gen/toobj.cpp @ 486:a34078905d01

Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in. Reimplemented support for nested functions/class using a new approach. Added error on taking address of intrinsic. Fixed problems with the ->syntaxCopy of TypeFunction delegate exp. Removed DtoDType and replaced all uses with ->toBasetype() instead. Removed unused inplace stuff. Fixed a bunch of issues in the runtime unittests, not complete yet. Added mini tests.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 10 Aug 2008 08:37:38 +0200
parents a3f3c2770a0d
children 017ca8645a1f
comparison
equal deleted inserted replaced
485:50f6e2337a6b 486:a34078905d01
53 53
54 ////////////////////////////////////////////////////////////////////////////////////////// 54 //////////////////////////////////////////////////////////////////////////////////////////
55 55
56 void Module::genobjfile(int multiobj) 56 void Module::genobjfile(int multiobj)
57 { 57 {
58 bool logenabled = Logger::enabled();
59 if (llvmForceLogging && !logenabled)
60 {
61 Logger::enable();
62 }
63
58 Logger::cout() << "Generating module: " << (md ? md->toChars() : toChars()) << '\n'; 64 Logger::cout() << "Generating module: " << (md ? md->toChars() : toChars()) << '\n';
59 LOG_SCOPE; 65 LOG_SCOPE;
66
67 //printf("codegen: %s\n", srcfile->toChars());
60 68
61 // start by deleting the old object file 69 // start by deleting the old object file
62 deleteObjFile(); 70 deleteObjFile();
63 71
64 // create a new ir state 72 // create a new ir state
159 LLPath bcpath; 167 LLPath bcpath;
160 LLPath llpath; 168 LLPath llpath;
161 169
162 if (global.params.fqnPaths) 170 if (global.params.fqnPaths)
163 { 171 {
164 bcpath = LLPath(md->toChars()); 172 bcpath = LLPath(mname);
165 bcpath.appendSuffix("bc"); 173 bcpath.appendSuffix("bc");
166 174
167 llpath = LLPath(md->toChars()); 175 llpath = LLPath(mname);
168 llpath.appendSuffix("ll"); 176 llpath.appendSuffix("ll");
169 } 177 }
170 else 178 else
171 { 179 {
172 bcpath = LLPath(bcfile->name->toChars()); 180 bcpath = LLPath(bcfile->name->toChars());
188 } 196 }
189 197
190 delete ir.module; 198 delete ir.module;
191 gTargetData = 0; 199 gTargetData = 0;
192 gIR = NULL; 200 gIR = NULL;
201
202 if (llvmForceLogging && !logenabled)
203 {
204 Logger::disable();
205 }
193 } 206 }
194 207
195 /* ================================================================== */ 208 /* ================================================================== */
196 209
197 // build module ctor 210 // build module ctor