Mercurial > projects > ddmd
comparison dmd/AssertExp.d @ 165:25ede4f66bda
Temporarily disabled GC (again) because phobos fails to compile with it (looks like some ObjSymbols are being falsely collected, see Library.d:666)
Getting rid of global state (i.e global and static variables) to allow running concurrent compilation
author | korDen |
---|---|
date | Thu, 30 Sep 2010 10:04:32 +0400 |
parents | e28b18c23469 |
children | af724d3510d7 |
comparison
equal
deleted
inserted
replaced
164:8bf07a566fdf | 165:25ede4f66bda |
---|---|
35 import dmd.backend.FL; | 35 import dmd.backend.FL; |
36 | 36 |
37 import core.stdc.string; | 37 import core.stdc.string; |
38 import std.string : toStringz; | 38 import std.string : toStringz; |
39 | 39 |
40 static __gshared Symbol* assertexp_sfilename = null; | 40 //static __gshared Symbol* assertexp_sfilename = null; |
41 static __gshared string assertexp_name = null; | 41 //static __gshared string assertexp_name = null; |
42 static __gshared Module assertexp_mn = null; | 42 //static __gshared Module assertexp_mn = null; |
43 | 43 |
44 class AssertExp : UnaExp | 44 class AssertExp : UnaExp |
45 { | 45 { |
46 Expression msg; | 46 Expression msg; |
47 | 47 |
105 override bool canThrow() | 105 override bool canThrow() |
106 { | 106 { |
107 /* assert()s are non-recoverable errors, so functions that | 107 /* assert()s are non-recoverable errors, so functions that |
108 * use them can be considered "nothrow" | 108 * use them can be considered "nothrow" |
109 */ | 109 */ |
110 return 0; //(global.params.useAssert != 0); | 110 return false; //(global.params.useAssert != 0); |
111 } | 111 } |
112 } | 112 } |
113 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 113 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
114 { | 114 { |
115 assert(false); | 115 assert(false); |
191 { | 191 { |
192 elem* efilename; | 192 elem* efilename; |
193 | 193 |
194 /* Cache values. | 194 /* Cache values. |
195 */ | 195 */ |
196 //static Symbol *assertexp_sfilename = null; | 196 Symbol* assertexp_sfilename = null; |
197 //static char *assertexp_name = null; | 197 string assertexp_name = null; |
198 //static Module *assertexp_mn = null; | 198 Module assertexp_mn = null; |
199 | 199 |
200 if (!assertexp_sfilename || loc.filename != assertexp_name || assertexp_mn != m) | 200 if (!assertexp_sfilename || loc.filename != assertexp_name || assertexp_mn != m) |
201 { | 201 { |
202 dt_t* dt = null; | 202 dt_t* dt = null; |
203 | 203 |