Mercurial > projects > ldc
annotate dmd/mars.h @ 1630:44b145be2ef5
Merge dmd 1.056.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Sat, 06 Feb 2010 15:53:52 +0000 |
parents | fb2e6707ad17 |
children | 9bf06e02070b |
rev | line source |
---|---|
159 | 1 |
2 // Compiler implementation of the D programming language | |
1630
44b145be2ef5
Merge dmd 1.056.
Robert Clipsham <robert@octarineparrot.com>
parents:
1621
diff
changeset
|
3 // Copyright (c) 1999-2010 by Digital Mars |
159 | 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 | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
16 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
17 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
18 /* |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
19 It is very important to use version control macros correctly - the |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
20 idea is that host and target are independent. If these are done |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
21 correctly, cross compilers can be built. |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
22 The host compiler and host operating system are also different, |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
23 and are predefined by the host compiler. The ones used in |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
24 dmd are: |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
25 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
26 Macros defined by the compiler, not the code: |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
27 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
28 Compiler: |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
29 __DMC__ Digital Mars compiler |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
30 _MSC_VER Microsoft compiler |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
31 __GNUC__ Gnu compiler |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
32 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
33 Host operating system: |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
34 _WIN32 Microsoft NT, Windows 95, Windows 98, Win32s, |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
35 Windows 2000, Win XP, Vista |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
36 _WIN64 Windows for AMD64 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
37 linux Linux |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
38 __APPLE__ Mac OSX |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
39 __FreeBSD__ FreeBSD |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
40 __sun&&__SVR4 Solaris, OpenSolaris (yes, both macros are necessary) |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
41 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
42 For the target systems, there are the target operating system and |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
43 the target object file format: |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
44 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
45 Target operating system: |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
46 TARGET_WINDOS Covers 32 bit windows and 64 bit windows |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
47 TARGET_LINUX Covers 32 and 64 bit linux |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
48 TARGET_OSX Covers 32 and 64 bit Mac OSX |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
49 TARGET_FREEBSD Covers 32 and 64 bit FreeBSD |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
50 TARGET_SOLARIS Covers 32 and 64 bit Solaris |
1587 | 51 TARGET_NET Covers .Net |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
52 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
53 It is expected that the compiler for each platform will be able |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
54 to generate 32 and 64 bit code from the same compiler binary. |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
55 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
56 Target object module format: |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
57 OMFOBJ Intel Object Module Format, used on Windows |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
58 ELFOBJ Elf Object Module Format, used on linux, FreeBSD and Solaris |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
59 MACHOBJ Mach-O Object Module Format, used on Mac OSX |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
60 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
61 There are currently no macros for byte endianness order. |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
62 */ |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
63 |
159 | 64 |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
65 #include <stdio.h> |
159 | 66 #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
|
67 #include <stdarg.h> |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
68 #include <stddef.h> |
305
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
69 #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
|
70 #include <inttypes.h> |
2b72433d5c8c
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents:
277
diff
changeset
|
71 #include <stdarg.h> |
159 | 72 |
73 #ifdef __DMC__ | |
74 #ifdef DEBUG | |
75 #undef assert | |
76 #define assert(e) (static_cast<void>((e) || (printf("assert %s(%d) %s\n", __FILE__, __LINE__, #e), halt()))) | |
77 #endif | |
78 #endif | |
79 | |
1372
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
80 #ifndef IS_PRINTF |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
81 # ifdef __GNUC__ |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
82 # define IS_PRINTF(FMTARG) __attribute((__format__ (__printf__, (FMTARG), (FMTARG)+1) )) |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
83 # else |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
84 # define IS_PRINTF(FMTARG) |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
85 # endif |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
86 #endif |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
87 |
159 | 88 #ifdef IN_GCC |
89 /* Changes for the GDC compiler by David Friedman */ | |
90 #endif | |
91 | |
336 | 92 #define DMDV2 0 // Version 2.0 features |
159 | 93 #define BREAKABI 1 // 0 if not ready to break the ABI just yet |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
94 #define STRUCTTHISREF DMDV2 // if 'this' for struct is a reference, not a pointer |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
95 #define SNAN_DEFAULT_INIT DMDV2 // if floats are default initialized to signalling NaN |
1602
a413ae7329bf
Merge DMD r243: some harmonization with D2 dmd
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
96 #define SARRAYVALUE DMDV2 // static arrays are value types |
a413ae7329bf
Merge DMD r243: some harmonization with D2 dmd
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
97 |
a413ae7329bf
Merge DMD r243: some harmonization with D2 dmd
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
98 // Set if C++ mangling is done by the front end |
a413ae7329bf
Merge DMD r243: some harmonization with D2 dmd
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
99 #define CPP_MANGLE (DMDV2 && (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS)) |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
100 |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
101 /* Other targets are TARGET_LINUX, TARGET_OSX, TARGET_FREEBSD and |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
102 * TARGET_SOLARIS, which are |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
103 * set on the command line via the compiler makefile. |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
104 */ |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
105 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
106 #if _WIN32 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
107 #define TARGET_WINDOS 1 // Windows dmd generates Windows targets |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
108 #define OMFOBJ 1 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
109 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
110 |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
111 #if TARGET_LINUX || TARGET_FREEBSD || TARGET_SOLARIS |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
112 #ifndef ELFOBJ |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
113 #define ELFOBJ 1 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
114 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
115 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
116 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
117 #if TARGET_OSX |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
118 #ifndef MACHOBJ |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
119 #define MACHOBJ 1 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
120 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
121 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
122 |
159 | 123 |
124 struct Array; | |
1402
1311dabc6a1f
Merged xfBuild patch for dependency tree generation. See #286.
Christian Kamm <kamm incasoftware de>
parents:
1372
diff
changeset
|
125 struct OutBuffer; |
159 | 126 |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
127 // LDC |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
128 enum ARCH |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
129 { |
566
68d7df3f9b05
Added some sanity checks for target detection.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
550
diff
changeset
|
130 ARCHinvalid, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
131 ARCHx86, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
132 ARCHx86_64, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
133 ARCHppc, |
734
6dcab994ddc3
Fold in mandel's patch for ARM from #106
Christian Kamm <kamm incasoftware de>
parents:
723
diff
changeset
|
134 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
|
135 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
|
136 ARCHthumb |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
137 }; |
708
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
138 enum OUTPUTFLAG |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
139 { |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
140 OUTPUTFLAGno, |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
141 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
|
142 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
|
143 }; |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
144 |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
145 enum OS |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
146 { |
566
68d7df3f9b05
Added some sanity checks for target detection.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
550
diff
changeset
|
147 OSinvalid, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
148 OSLinux, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
149 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
|
150 OSMacOSX, |
872
aa953cc960b6
Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.
Christian Kamm <kamm incasoftware de>
parents:
853
diff
changeset
|
151 OSFreeBSD, |
aa953cc960b6
Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.
Christian Kamm <kamm incasoftware de>
parents:
853
diff
changeset
|
152 OSSolaris, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
153 }; |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
154 |
1281
29d3861aa2da
Make sure this still compiles after LLVM r70437, which introduces a
Frits van Bommel <fvbommel wxs.nl>
parents:
1195
diff
changeset
|
155 typedef unsigned char ubyte; |
29d3861aa2da
Make sure this still compiles after LLVM r70437, which introduces a
Frits van Bommel <fvbommel wxs.nl>
parents:
1195
diff
changeset
|
156 |
159 | 157 // Put command line switches in here |
158 struct Param | |
159 { | |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
160 bool obj; // write object file |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
161 bool link; // perform link |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
162 bool verbose; // verbose compile |
1281
29d3861aa2da
Make sure this still compiles after LLVM r70437, which introduces a
Frits van Bommel <fvbommel wxs.nl>
parents:
1195
diff
changeset
|
163 ubyte symdebug; // insert debug symbolic information |
1170
e40c65bd8c5d
Allow specific optimization passes to be requested from the command line.
Frits van Bommel <fvbommel wxs.nl>
parents:
1124
diff
changeset
|
164 #if !IN_LLVM |
e40c65bd8c5d
Allow specific optimization passes to be requested from the command line.
Frits van Bommel <fvbommel wxs.nl>
parents:
1124
diff
changeset
|
165 // LDC uses a different mechanism |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
166 bool optimize; // run optimizer |
159 | 167 char optimizeLevel; // optimization level |
1170
e40c65bd8c5d
Allow specific optimization passes to be requested from the command line.
Frits van Bommel <fvbommel wxs.nl>
parents:
1124
diff
changeset
|
168 #endif |
1587 | 169 char vtls; // identify thread local variables |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
170 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
|
171 OS os; // target OS |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
172 bool is64bit; // generate 64 bit code |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
173 bool isLE; // generate little endian code |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
174 bool useDeprecated; // allow use of deprecated features |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
175 bool useAssert; // generate runtime code for assert()'s |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
176 bool useInvariants; // generate class invariant checks |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
177 bool useIn; // generate precondition checks |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
178 bool useOut; // generate postcondition checks |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
179 bool useArrayBounds; // generate array bounds checks |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
180 bool useSwitchError; // check for switches without a default |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
181 bool useUnitTests; // generate unittest code |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
182 bool useInline; // inline expand functions |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
183 bool warnings; // enable warnings |
1281
29d3861aa2da
Make sure this still compiles after LLVM r70437, which introduces a
Frits van Bommel <fvbommel wxs.nl>
parents:
1195
diff
changeset
|
184 ubyte Dversion; // D version number |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
185 char safe; // enforce safe memory model |
159 | 186 |
187 char *argv0; // program name | |
188 Array *imppath; // array of char*'s of where to look for import modules | |
189 Array *fileImppath; // array of char*'s of where to look for file import modules | |
190 char *objdir; // .obj file output directory | |
191 char *objname; // .obj file output name | |
192 | |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
193 bool doDocComments; // process embedded documentation comments |
159 | 194 char *docdir; // write documentation file to docdir directory |
195 char *docname; // write documentation file to docname | |
196 Array *ddocfiles; // macro include files for Ddoc | |
197 | |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
198 bool doHdrGeneration; // process embedded documentation comments |
159 | 199 char *hdrdir; // write 'header' file to docdir directory |
200 char *hdrname; // write 'header' file to docname | |
201 | |
1587 | 202 char doXGeneration; // write JSON file |
203 char *xfilename; // write JSON file to xfilename | |
204 | |
159 | 205 unsigned debuglevel; // debug level |
206 Array *debugids; // debug identifiers | |
207 | |
208 unsigned versionlevel; // version level | |
209 Array *versionids; // version identifiers | |
210 | |
211 bool dump_source; | |
212 | |
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
|
213 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
|
214 Array *debuglibnames; // default libraries for debug builds |
159 | 215 |
1587 | 216 char *moduleDepsFile; // filename for deps output |
217 OutBuffer *moduleDeps; // contents to be written to deps file | |
218 | |
159 | 219 // Hidden debug switches |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
220 bool debuga; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
221 bool debugb; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
222 bool debugc; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
223 bool debugf; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
224 bool debugr; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
225 bool debugw; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
226 bool debugx; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
227 bool debugy; |
159 | 228 |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
229 bool run; // run resulting executable |
159 | 230 |
231 // Linker stuff | |
232 Array *objfiles; | |
233 Array *linkswitches; | |
234 Array *libfiles; | |
235 char *deffile; | |
236 char *resfile; | |
237 char *exefile; | |
1630
44b145be2ef5
Merge dmd 1.056.
Robert Clipsham <robert@octarineparrot.com>
parents:
1621
diff
changeset
|
238 char *mapfile; |
159 | 239 |
1630
44b145be2ef5
Merge dmd 1.056.
Robert Clipsham <robert@octarineparrot.com>
parents:
1621
diff
changeset
|
240 #if IN_LLVM |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
241 // LDC stuff |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
242 OUTPUTFLAG output_ll; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
243 OUTPUTFLAG output_bc; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
244 OUTPUTFLAG output_s; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
245 OUTPUTFLAG output_o; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
246 bool llvmAnnotate; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
247 bool useInlineAsm; |
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
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1281
diff
changeset
|
248 bool verbose_cg; |
1482
d9c5f5a43403
Run `semantic3` on imported modules, and emit new symbols with
Frits van Bommel <fvbommel wxs.nl>
parents:
1402
diff
changeset
|
249 bool useAvailableExternally; |
699
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
694
diff
changeset
|
250 |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
694
diff
changeset
|
251 // target stuff |
988
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
252 const char* llvmArch; |
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
253 const char *targetTriple; |
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
254 const char *dataLayout; |
1630
44b145be2ef5
Merge dmd 1.056.
Robert Clipsham <robert@octarineparrot.com>
parents:
1621
diff
changeset
|
255 #endif |
159 | 256 }; |
257 | |
258 struct Global | |
259 { | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
260 const char *mars_ext; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
261 const char *sym_ext; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
262 const 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
|
263 #if _WIN32 |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
264 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
|
265 #endif |
159 | 266 char *ll_ext; |
267 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
|
268 char *s_ext; |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
269 const char *lib_ext; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
270 const char *doc_ext; // for Ddoc generated files |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
271 const char *ddoc_ext; // for Ddoc macro include files |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
272 const char *hdr_ext; // for D 'header' import files |
1587 | 273 const char *json_ext; // for JSON files |
1630
44b145be2ef5
Merge dmd 1.056.
Robert Clipsham <robert@octarineparrot.com>
parents:
1621
diff
changeset
|
274 const char *map_ext; // for .map files |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
275 const char *copyright; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
276 const char *written; |
159 | 277 Array *path; // Array of char*'s which form the import lookup path |
278 Array *filePath; // Array of char*'s which form the file import lookup path | |
279 int structalign; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
280 const char *version; |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
281 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
|
282 char *llvm_version; |
159 | 283 |
284 Param params; | |
285 unsigned errors; // number of errors reported so far | |
286 unsigned gag; // !=0 means gag reporting of errors | |
287 | |
288 Global(); | |
289 }; | |
290 | |
291 extern Global global; | |
292 | |
876
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
293 /* 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
|
294 * Apparently, VC has dropped support for these? |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
295 */ |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
296 #define WINDOWS_SEH (_WIN32 && __DMC__) |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
297 |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
298 |
159 | 299 #ifdef __DMC__ |
300 typedef _Complex long double complex_t; | |
301 #else | |
302 #ifndef IN_GCC | |
303 #include "complex_t.h" | |
304 #endif | |
305 #ifdef __APPLE__ | |
306 //#include "complex.h"//This causes problems with include the c++ <complex> and not the C "complex.h" | |
307 #endif | |
308 #endif | |
309 | |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
310 // Be careful not to care about sign when using dinteger_t |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
311 //typedef uint64_t integer_t; |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
312 typedef uint64_t dinteger_t; // use this instead of integer_t to |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
313 // avoid conflicts with system #include's |
159 | 314 |
315 // Signed and unsigned variants | |
316 typedef int64_t sinteger_t; | |
317 typedef uint64_t uinteger_t; | |
318 | |
319 typedef int8_t d_int8; | |
320 typedef uint8_t d_uns8; | |
321 typedef int16_t d_int16; | |
322 typedef uint16_t d_uns16; | |
323 typedef int32_t d_int32; | |
324 typedef uint32_t d_uns32; | |
325 typedef int64_t d_int64; | |
326 typedef uint64_t d_uns64; | |
327 | |
328 typedef float d_float32; | |
329 typedef double d_float64; | |
330 typedef long double d_float80; | |
331 | |
332 typedef d_uns8 d_char; | |
333 typedef d_uns16 d_wchar; | |
334 typedef d_uns32 d_dchar; | |
335 | |
336 #ifdef IN_GCC | |
337 #include "d-gcc-real.h" | |
338 #else | |
339 typedef long double real_t; | |
340 #endif | |
341 | |
342 // Modify OutBuffer::writewchar to write the correct size of wchar | |
343 #if _WIN32 | |
344 #define writewchar writeword | |
345 #else | |
346 // This needs a configuration test... | |
347 #define writewchar write4 | |
348 #endif | |
349 | |
350 #ifdef IN_GCC | |
351 #include "d-gcc-complex_t.h" | |
352 #endif | |
353 | |
354 struct Module; | |
355 | |
356 //typedef unsigned Loc; // file location | |
357 struct Loc | |
358 { | |
1587 | 359 const char *filename; |
159 | 360 unsigned linnum; |
361 | |
362 Loc() | |
363 { | |
364 linnum = 0; | |
365 filename = NULL; | |
366 } | |
367 | |
368 Loc(int x) | |
369 { | |
370 linnum = x; | |
371 filename = NULL; | |
372 } | |
373 | |
374 Loc(Module *mod, unsigned linnum); | |
375 | |
376 char *toChars() const; | |
1587 | 377 bool equals(const Loc& loc); |
159 | 378 }; |
379 | |
380 #ifndef GCC_SAFE_DMD | |
381 #define TRUE 1 | |
382 #define FALSE 0 | |
383 #endif | |
384 | |
385 #define INTERFACE_OFFSET 0 // if 1, put classinfo as first entry | |
386 // in interface vtbl[]'s | |
387 #define INTERFACE_VIRTUAL 0 // 1 means if an interface appears | |
388 // in the inheritance graph multiple | |
389 // times, only one is used | |
390 | |
391 enum LINK | |
392 { | |
393 LINKdefault, | |
394 LINKd, | |
395 LINKc, | |
396 LINKcpp, | |
397 LINKwindows, | |
398 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
|
399 |
1630
44b145be2ef5
Merge dmd 1.056.
Robert Clipsham <robert@octarineparrot.com>
parents:
1621
diff
changeset
|
400 #if IN_LLVM |
723
55f6c2e454d7
Implemented correct parameter order according to x86-32 ABI documentation.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
708
diff
changeset
|
401 LINKintrinsic, |
1630
44b145be2ef5
Merge dmd 1.056.
Robert Clipsham <robert@octarineparrot.com>
parents:
1621
diff
changeset
|
402 #endif |
159 | 403 }; |
404 | |
405 enum DYNCAST | |
406 { | |
407 DYNCAST_OBJECT, | |
408 DYNCAST_EXPRESSION, | |
409 DYNCAST_DSYMBOL, | |
410 DYNCAST_TYPE, | |
411 DYNCAST_IDENTIFIER, | |
412 DYNCAST_TUPLE, | |
413 }; | |
414 | |
415 enum MATCH | |
416 { | |
417 MATCHnomatch, // no match | |
418 MATCHconvert, // match with conversions | |
336 | 419 #if DMDV2 |
159 | 420 MATCHconst, // match with conversion to const |
421 #endif | |
422 MATCHexact // exact match | |
423 }; | |
424 | |
1621
fb2e6707ad17
Merge DMD r314+r315: bugzilla 2029 Typesafe variadic functions don't...
Leandro Lucarella <llucax@gmail.com>
parents:
1602
diff
changeset
|
425 typedef uint64_t StorageClass; |
1602
a413ae7329bf
Merge DMD r243: some harmonization with D2 dmd
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
426 |
a413ae7329bf
Merge DMD r243: some harmonization with D2 dmd
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
427 |
1372
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
428 void warning(Loc loc, const char *format, ...) IS_PRINTF(2); |
1124
e7f0c2b48047
Fix a bug where ::warning() was called with a va_list argument instead of an
Frits van Bommel <fvbommel wxs.nl>
parents:
1103
diff
changeset
|
429 void vwarning(Loc loc, const char *format, va_list); |
1372
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
430 void error(Loc loc, const char *format, ...) IS_PRINTF(2); |
159 | 431 void verror(Loc loc, const char *format, va_list); |
1586
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
432 |
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
433 #ifdef __GNUC__ |
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
434 __attribute__((noreturn)) |
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
435 #endif |
159 | 436 void fatal(); |
1586
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
437 |
159 | 438 void err_nomem(); |
988
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
439 void inifile(char *argv0, const char *inifile); |
159 | 440 void halt(); |
441 | |
442 /*** 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
|
443 #if IN_GCC || IN_LLVM |
159 | 444 #define stdmsg stderr |
445 #else | |
1587 | 446 #define stdmsg stderr |
159 | 447 #endif |
448 | |
449 #endif /* DMD_MARS_H */ |