Mercurial > projects > ldc
annotate dmd/mars.h @ 973:d96471e8b5e5
Fix #216 by implementing TypeExp::toElem. It just provides the appropriate
error message.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 17 Feb 2009 18:25:34 +0100 |
parents | a4fcc13da3cd |
children | a8cb25d478c4 |
rev | line source |
---|---|
159 | 1 |
2 // Compiler implementation of the D programming language | |
3 // Copyright (c) 1999-2007 by Digital Mars | |
4 // All Rights Reserved | |
5 // written by Walter Bright | |
6 // http://www.digitalmars.com | |
7 // License for redistribution is by either the Artistic License | |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | |
9 // See the included readme.txt for details. | |
10 | |
11 #ifndef DMD_MARS_H | |
12 #define DMD_MARS_H | |
13 | |
14 #ifdef __DMC__ | |
15 #pragma once | |
16 #endif /* __DMC__ */ | |
17 | |
18 #include <stdint.h> | |
305
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
19 #include <stdarg.h> |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
20 #define __STDC_FORMAT_MACROS 1 |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
21 #include <inttypes.h> |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
22 #include <stdarg.h> |
159 | 23 |
24 #ifdef __DMC__ | |
25 #ifdef DEBUG | |
26 #undef assert | |
27 #define assert(e) (static_cast<void>((e) || (printf("assert %s(%d) %s\n", __FILE__, __LINE__, #e), halt()))) | |
28 #endif | |
29 #endif | |
30 | |
31 #ifdef IN_GCC | |
32 /* Changes for the GDC compiler by David Friedman */ | |
33 #endif | |
34 | |
336 | 35 #define DMDV2 0 // Version 2.0 features |
159 | 36 #define BREAKABI 1 // 0 if not ready to break the ABI just yet |
37 | |
38 struct Array; | |
39 | |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
40 // LDC |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
41 enum ARCH |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
42 { |
566
68d7df3f9b05
Added some sanity checks for target detection.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
550
diff
changeset
|
43 ARCHinvalid, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
44 ARCHx86, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
45 ARCHx86_64, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
46 ARCHppc, |
734
6dcab994ddc3
Fold in mandel's patch for ARM from #106
Christian Kamm <kamm incasoftware de>
parents:
723
diff
changeset
|
47 ARCHppc_64, |
735
eee9efe5b51f
Attempt at getting LLVM to provide a proper target data layout. Should assert now if things are borked.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
734
diff
changeset
|
48 ARCHarm, |
eee9efe5b51f
Attempt at getting LLVM to provide a proper target data layout. Should assert now if things are borked.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
734
diff
changeset
|
49 ARCHthumb |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
50 }; |
708
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
51 enum OUTPUTFLAG |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
52 { |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
53 OUTPUTFLAGno, |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
54 OUTPUTFLAGdefault, // for the .o default |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
55 OUTPUTFLAGset // for -output |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
56 }; |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
57 |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
58 enum OS |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
59 { |
566
68d7df3f9b05
Added some sanity checks for target detection.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
550
diff
changeset
|
60 OSinvalid, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
61 OSLinux, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
62 OSWindows, |
637
29dc68c949b0
Applied the FreeBSD patch from Ralith, closes ticket #95 , slightly changed but basically the same. Thanx Ralith :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
580
diff
changeset
|
63 OSMacOSX, |
872
aa953cc960b6
Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.
Christian Kamm <kamm incasoftware de>
parents:
853
diff
changeset
|
64 OSFreeBSD, |
aa953cc960b6
Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.
Christian Kamm <kamm incasoftware de>
parents:
853
diff
changeset
|
65 OSSolaris, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
66 }; |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
67 |
918
a4fcc13da3cd
Changed templates and typeinfo to use linkonce linkage instead of weak linkage, this should fix inlining problems, fixing bug #197 . If problems show up, it's easy to change it back by changing the define in mars.h . I'm 95% sure this is safe, given how we handle templates.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
876
diff
changeset
|
68 // make it easier to test new linkage types |
a4fcc13da3cd
Changed templates and typeinfo to use linkonce linkage instead of weak linkage, this should fix inlining problems, fixing bug #197 . If problems show up, it's easy to change it back by changing the define in mars.h . I'm 95% sure this is safe, given how we handle templates.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
876
diff
changeset
|
69 #define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceLinkage |
a4fcc13da3cd
Changed templates and typeinfo to use linkonce linkage instead of weak linkage, this should fix inlining problems, fixing bug #197 . If problems show up, it's easy to change it back by changing the define in mars.h . I'm 95% sure this is safe, given how we handle templates.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
876
diff
changeset
|
70 #define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceLinkage |
a4fcc13da3cd
Changed templates and typeinfo to use linkonce linkage instead of weak linkage, this should fix inlining problems, fixing bug #197 . If problems show up, it's easy to change it back by changing the define in mars.h . I'm 95% sure this is safe, given how we handle templates.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
876
diff
changeset
|
71 |
159 | 72 // Put command line switches in here |
73 struct Param | |
74 { | |
75 char obj; // write object file | |
76 char link; // perform link | |
77 char quiet; // suppress non-error messages | |
78 char verbose; // verbose compile | |
79 char symdebug; // insert debug symbolic information | |
80 char optimize; // run optimizer | |
81 char optimizeLevel; // optimization level | |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
82 ARCH cpu; // target CPU |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
83 OS os; // target OS |
159 | 84 char is64bit; // generate 64 bit code |
85 char isLE; // generate little endian code | |
86 char scheduler; // which scheduler to use | |
87 char useDeprecated; // allow use of deprecated features | |
88 char useAssert; // generate runtime code for assert()'s | |
89 char useInvariants; // generate class invariant checks | |
90 char useIn; // generate precondition checks | |
91 char useOut; // generate postcondition checks | |
92 char useArrayBounds; // generate array bounds checks | |
93 char useSwitchError; // check for switches without a default | |
94 char useUnitTests; // generate unittest code | |
95 char useInline; // inline expand functions | |
96 char preservePaths; // !=0 means don't strip path from source file | |
97 char warnings; // enable warnings | |
98 char pic; // generate position-independent-code for shared libs | |
99 char noruntime; // code is not allowed to make implicit calls to the runtime | |
100 char novalidate;// no bitcode validation | |
101 char Dversion; // D version number | |
102 char ignoreUnsupportedPragmas; // rather than error on them | |
103 | |
104 char *argv0; // program name | |
105 Array *imppath; // array of char*'s of where to look for import modules | |
106 Array *fileImppath; // array of char*'s of where to look for file import modules | |
107 char *runtimeImppath; // char* of where to look for the core runtime | |
108 char *objdir; // .obj file output directory | |
109 char *objname; // .obj file output name | |
110 | |
111 char doDocComments; // process embedded documentation comments | |
112 char *docdir; // write documentation file to docdir directory | |
113 char *docname; // write documentation file to docname | |
114 Array *ddocfiles; // macro include files for Ddoc | |
115 | |
116 char doHdrGeneration; // process embedded documentation comments | |
117 char *hdrdir; // write 'header' file to docdir directory | |
118 char *hdrname; // write 'header' file to docname | |
119 | |
120 unsigned debuglevel; // debug level | |
121 Array *debugids; // debug identifiers | |
122 | |
123 unsigned versionlevel; // version level | |
124 Array *versionids; // version identifiers | |
125 | |
126 bool dump_source; | |
127 | |
567
aaba4f7c6d8a
Get rid of runtime path. Allow defaultlib and debuglib switches to be given multiple times.
Christian Kamm <kamm incasoftware de>
parents:
550
diff
changeset
|
128 Array *defaultlibnames; // default libraries for non-debug builds |
aaba4f7c6d8a
Get rid of runtime path. Allow defaultlib and debuglib switches to be given multiple times.
Christian Kamm <kamm incasoftware de>
parents:
550
diff
changeset
|
129 Array *debuglibnames; // default libraries for debug builds |
159 | 130 |
131 char *xmlname; // filename for XML output | |
132 | |
133 // Hidden debug switches | |
134 char debuga; | |
135 char debugb; | |
136 char debugc; | |
137 char debugf; | |
138 char debugr; | |
139 char debugw; | |
140 char debugx; | |
141 char debugy; | |
142 | |
143 char run; // run resulting executable | |
144 size_t runargs_length; | |
145 char** runargs; // arguments for executable | |
146 | |
147 // Linker stuff | |
148 Array *objfiles; | |
149 Array *linkswitches; | |
150 Array *libfiles; | |
151 char *deffile; | |
152 char *resfile; | |
153 char *exefile; | |
154 | |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
155 // LDC stuff |
159 | 156 char *llvmArch; |
157 char forceBE; | |
675
bfe5229f9d8e
Disable bc output by default. Remove -dis. Add -output-bc, -output-ll, -output-s.
Christian Kamm <kamm incasoftware de>
parents:
663
diff
changeset
|
158 char output_ll; |
bfe5229f9d8e
Disable bc output by default. Remove -dis. Add -output-bc, -output-ll, -output-s.
Christian Kamm <kamm incasoftware de>
parents:
663
diff
changeset
|
159 char output_bc; |
bfe5229f9d8e
Disable bc output by default. Remove -dis. Add -output-bc, -output-ll, -output-s.
Christian Kamm <kamm incasoftware de>
parents:
663
diff
changeset
|
160 char output_s; |
694
931333ea35c6
Allow output of only bc, ll, or s by making -of set the output type depending
Christian Kamm <kamm incasoftware de>
parents:
675
diff
changeset
|
161 char output_o; |
159 | 162 char llvmInline; |
163 char llvmAnnotate; | |
220
ccc2e6898a78
[svn r236] added initial codegen of inline asm, pretty buggy and incomplete still. see the tangotests/asm1.d test for a sample of what does
lindquist
parents:
217
diff
changeset
|
164 char useInlineAsm; |
580
7824c21a58e3
Restructure path handling a bit. Fixes #66.
Christian Kamm <kamm incasoftware de>
parents:
568
diff
changeset
|
165 char fqnNames; // use fully qualified object names |
651
5709381df7e8
Added -nodefaultlib switch do disable implicitly linked standard lib modules
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
637
diff
changeset
|
166 char noDefaultLib; |
699
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
694
diff
changeset
|
167 |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
694
diff
changeset
|
168 // target stuff |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
694
diff
changeset
|
169 char *targetTriple; |
735
eee9efe5b51f
Attempt at getting LLVM to provide a proper target data layout. Should assert now if things are borked.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
734
diff
changeset
|
170 char *dataLayout; |
159 | 171 }; |
172 | |
173 struct Global | |
174 { | |
175 char *mars_ext; | |
176 char *sym_ext; | |
177 char *obj_ext; | |
708
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
178 #if _WIN32 |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
179 char *obj_ext_alt; |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
180 #endif |
159 | 181 char *ll_ext; |
182 char *bc_ext; | |
675
bfe5229f9d8e
Disable bc output by default. Remove -dis. Add -output-bc, -output-ll, -output-s.
Christian Kamm <kamm incasoftware de>
parents:
663
diff
changeset
|
183 char *s_ext; |
159 | 184 char *doc_ext; // for Ddoc generated files |
185 char *ddoc_ext; // for Ddoc macro include files | |
186 char *hdr_ext; // for D 'header' import files | |
187 char *copyright; | |
188 char *written; | |
189 Array *path; // Array of char*'s which form the import lookup path | |
190 Array *filePath; // Array of char*'s which form the file import lookup path | |
191 int structalign; | |
192 char *version; | |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
193 char *ldc_version; |
853
82ad6c0c601c
Add Elrood's patch to output LDC and LLVM source revs.
Christian Kamm <kamm incasoftware de>
parents:
797
diff
changeset
|
194 char *llvm_version; |
159 | 195 |
196 Param params; | |
197 unsigned errors; // number of errors reported so far | |
198 unsigned gag; // !=0 means gag reporting of errors | |
199 | |
200 Global(); | |
201 }; | |
202 | |
203 extern Global global; | |
204 | |
876
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
205 /* Set if Windows Structured Exception Handling C extensions are supported. |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
206 * Apparently, VC has dropped support for these? |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
207 */ |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
208 #define WINDOWS_SEH (_WIN32 && __DMC__) |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
209 |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
210 |
159 | 211 #if __GNUC__ |
212 //#define memicmp strncasecmp | |
213 //#define stricmp strcasecmp | |
214 #endif | |
215 | |
216 #ifdef __DMC__ | |
217 typedef _Complex long double complex_t; | |
218 #else | |
219 #ifndef IN_GCC | |
220 #include "complex_t.h" | |
221 #endif | |
222 #ifdef __APPLE__ | |
223 //#include "complex.h"//This causes problems with include the c++ <complex> and not the C "complex.h" | |
224 #define integer_t dmd_integer_t | |
225 #endif | |
226 #endif | |
227 | |
228 // Be careful not to care about sign when using integer_t | |
229 typedef uint64_t integer_t; | |
230 | |
231 // Signed and unsigned variants | |
232 typedef int64_t sinteger_t; | |
233 typedef uint64_t uinteger_t; | |
234 | |
235 typedef int8_t d_int8; | |
236 typedef uint8_t d_uns8; | |
237 typedef int16_t d_int16; | |
238 typedef uint16_t d_uns16; | |
239 typedef int32_t d_int32; | |
240 typedef uint32_t d_uns32; | |
241 typedef int64_t d_int64; | |
242 typedef uint64_t d_uns64; | |
243 | |
244 typedef float d_float32; | |
245 typedef double d_float64; | |
246 typedef long double d_float80; | |
247 | |
248 typedef d_uns8 d_char; | |
249 typedef d_uns16 d_wchar; | |
250 typedef d_uns32 d_dchar; | |
251 | |
252 #ifdef IN_GCC | |
253 #include "d-gcc-real.h" | |
254 #else | |
255 typedef long double real_t; | |
256 #endif | |
257 | |
258 // Modify OutBuffer::writewchar to write the correct size of wchar | |
259 #if _WIN32 | |
260 #define writewchar writeword | |
261 #else | |
262 // This needs a configuration test... | |
263 #define writewchar write4 | |
264 #endif | |
265 | |
266 #ifdef IN_GCC | |
267 #include "d-gcc-complex_t.h" | |
268 #endif | |
269 | |
305
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
270 // taken from GDC |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
271 // for handling printf incompatibilities |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
272 #if __MSVCRT__ |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
273 #define PRIuSIZE "Iu" |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
274 #define PRIxSIZE "Ix" |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
275 #elif __MINGW32__ |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
276 #define PRIuSIZE "u" |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
277 #define PRIxSIZE "x" |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
278 #else |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
279 #define PRIuSIZE "zu" |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
280 #define PRIxSIZE "zx" |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
281 #endif |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
282 |
159 | 283 struct Module; |
284 | |
285 //typedef unsigned Loc; // file location | |
286 struct Loc | |
287 { | |
288 char *filename; | |
289 unsigned linnum; | |
290 | |
291 Loc() | |
292 { | |
293 linnum = 0; | |
294 filename = NULL; | |
295 } | |
296 | |
297 Loc(int x) | |
298 { | |
299 linnum = x; | |
300 filename = NULL; | |
301 } | |
302 | |
303 Loc(Module *mod, unsigned linnum); | |
304 | |
305 char *toChars() const; | |
306 }; | |
307 | |
308 #ifndef GCC_SAFE_DMD | |
309 #define TRUE 1 | |
310 #define FALSE 0 | |
311 #endif | |
312 | |
313 #define INTERFACE_OFFSET 0 // if 1, put classinfo as first entry | |
314 // in interface vtbl[]'s | |
315 #define INTERFACE_VIRTUAL 0 // 1 means if an interface appears | |
316 // in the inheritance graph multiple | |
317 // times, only one is used | |
318 | |
319 enum LINK | |
320 { | |
321 LINKdefault, | |
322 LINKd, | |
323 LINKc, | |
324 LINKcpp, | |
325 LINKwindows, | |
326 LINKpascal, | |
723
55f6c2e454d7
Implemented correct parameter order according to x86-32 ABI documentation.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
708
diff
changeset
|
327 |
55f6c2e454d7
Implemented correct parameter order according to x86-32 ABI documentation.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
708
diff
changeset
|
328 // LDC |
55f6c2e454d7
Implemented correct parameter order according to x86-32 ABI documentation.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
708
diff
changeset
|
329 LINKintrinsic, |
159 | 330 }; |
331 | |
332 enum DYNCAST | |
333 { | |
334 DYNCAST_OBJECT, | |
335 DYNCAST_EXPRESSION, | |
336 DYNCAST_DSYMBOL, | |
337 DYNCAST_TYPE, | |
338 DYNCAST_IDENTIFIER, | |
339 DYNCAST_TUPLE, | |
340 }; | |
341 | |
342 enum MATCH | |
343 { | |
344 MATCHnomatch, // no match | |
345 MATCHconvert, // match with conversions | |
336 | 346 #if DMDV2 |
159 | 347 MATCHconst, // match with conversion to const |
348 #endif | |
349 MATCHexact // exact match | |
350 }; | |
351 | |
352 void error(Loc loc, const char *format, ...); | |
353 void verror(Loc loc, const char *format, va_list); | |
354 void fatal(); | |
355 void err_nomem(); | |
356 void inifile(char *argv0, char *inifile); | |
357 void halt(); | |
358 | |
359 /*** Where to send error messages ***/ | |
797
340acf1535d0
Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
735
diff
changeset
|
360 #if IN_GCC || IN_LLVM |
159 | 361 #define stdmsg stderr |
362 #else | |
363 #define stdmsg stdout | |
364 #endif | |
365 | |
366 #endif /* DMD_MARS_H */ |