Mercurial > projects > ldc
annotate dmd/mars.h @ 1594:9f7151d890ff
Added in forgotten json.c and json.h files so ldc compiles again.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Sat, 07 Nov 2009 14:21:56 +0000 |
parents | def7a1d494fd |
children | a413ae7329bf |
rev | line source |
---|---|
159 | 1 |
2 // Compiler implementation of the D programming language | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
3 // Copyright (c) 1999-2009 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 |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
96 |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
97 /* 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
|
98 * TARGET_SOLARIS, which are |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
99 * 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
|
100 */ |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
101 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
102 #if _WIN32 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
103 #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
|
104 #define OMFOBJ 1 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
105 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
106 |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
107 #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
|
108 #ifndef ELFOBJ |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
109 #define ELFOBJ 1 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
110 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
111 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
112 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
113 #if TARGET_OSX |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
114 #ifndef MACHOBJ |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
115 #define MACHOBJ 1 |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
116 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
117 #endif |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
118 |
159 | 119 |
120 struct Array; | |
1402
1311dabc6a1f
Merged xfBuild patch for dependency tree generation. See #286.
Christian Kamm <kamm incasoftware de>
parents:
1372
diff
changeset
|
121 struct OutBuffer; |
159 | 122 |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
123 // LDC |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
124 enum ARCH |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
125 { |
566
68d7df3f9b05
Added some sanity checks for target detection.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
550
diff
changeset
|
126 ARCHinvalid, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
127 ARCHx86, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
128 ARCHx86_64, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
129 ARCHppc, |
734
6dcab994ddc3
Fold in mandel's patch for ARM from #106
Christian Kamm <kamm incasoftware de>
parents:
723
diff
changeset
|
130 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
|
131 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
|
132 ARCHthumb |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
133 }; |
708
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
134 enum OUTPUTFLAG |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
135 { |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
136 OUTPUTFLAGno, |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
137 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
|
138 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
|
139 }; |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
140 |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
141 enum OS |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
142 { |
566
68d7df3f9b05
Added some sanity checks for target detection.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
550
diff
changeset
|
143 OSinvalid, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
144 OSLinux, |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
145 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
|
146 OSMacOSX, |
872
aa953cc960b6
Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.
Christian Kamm <kamm incasoftware de>
parents:
853
diff
changeset
|
147 OSFreeBSD, |
aa953cc960b6
Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.
Christian Kamm <kamm incasoftware de>
parents:
853
diff
changeset
|
148 OSSolaris, |
534
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
149 }; |
7e2867ed70d9
Get rid of isLinux and isWindows in favor of global.params.os.
Christian Kamm <kamm incasoftware de>
parents:
445
diff
changeset
|
150 |
1281
29d3861aa2da
Make sure this still compiles after LLVM r70437, which introduces a
Frits van Bommel <fvbommel wxs.nl>
parents:
1195
diff
changeset
|
151 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
|
152 |
159 | 153 // Put command line switches in here |
154 struct Param | |
155 { | |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
156 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
|
157 bool link; // perform link |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
158 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
|
159 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
|
160 #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
|
161 // 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
|
162 bool optimize; // run optimizer |
159 | 163 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
|
164 #endif |
1587 | 165 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
|
166 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
|
167 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
|
168 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
|
169 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
|
170 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
|
171 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
|
172 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
|
173 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
|
174 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
|
175 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
|
176 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
|
177 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
|
178 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
|
179 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
|
180 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
|
181 char safe; // enforce safe memory model |
159 | 182 |
183 char *argv0; // program name | |
184 Array *imppath; // array of char*'s of where to look for import modules | |
185 Array *fileImppath; // array of char*'s of where to look for file import modules | |
186 char *objdir; // .obj file output directory | |
187 char *objname; // .obj file output name | |
188 | |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
189 bool doDocComments; // process embedded documentation comments |
159 | 190 char *docdir; // write documentation file to docdir directory |
191 char *docname; // write documentation file to docname | |
192 Array *ddocfiles; // macro include files for Ddoc | |
193 | |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
194 bool doHdrGeneration; // process embedded documentation comments |
159 | 195 char *hdrdir; // write 'header' file to docdir directory |
196 char *hdrname; // write 'header' file to docname | |
197 | |
1587 | 198 char doXGeneration; // write JSON file |
199 char *xfilename; // write JSON file to xfilename | |
200 | |
159 | 201 unsigned debuglevel; // debug level |
202 Array *debugids; // debug identifiers | |
203 | |
204 unsigned versionlevel; // version level | |
205 Array *versionids; // version identifiers | |
206 | |
207 bool dump_source; | |
208 | |
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
|
209 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
|
210 Array *debuglibnames; // default libraries for debug builds |
159 | 211 |
1587 | 212 char *moduleDepsFile; // filename for deps output |
213 OutBuffer *moduleDeps; // contents to be written to deps file | |
214 | |
159 | 215 // Hidden debug switches |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
216 bool debuga; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
217 bool debugb; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
218 bool debugc; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
219 bool debugf; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
220 bool debugr; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
221 bool debugw; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
222 bool debugx; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
223 bool debugy; |
159 | 224 |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
225 bool run; // run resulting executable |
159 | 226 |
227 // Linker stuff | |
228 Array *objfiles; | |
229 Array *linkswitches; | |
230 Array *libfiles; | |
231 char *deffile; | |
232 char *resfile; | |
233 char *exefile; | |
234 | |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
235 // LDC stuff |
986
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
236 OUTPUTFLAG output_ll; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
237 OUTPUTFLAG output_bc; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
238 OUTPUTFLAG output_s; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
239 OUTPUTFLAG output_o; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
240 bool llvmAnnotate; |
a8cb25d478c4
Use LLVM-style command line (instead of DMD-style)
Frits van Bommel <fvbommel wxs.nl>
parents:
918
diff
changeset
|
241 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
|
242 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
|
243 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
|
244 |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
694
diff
changeset
|
245 // target stuff |
988
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
246 const char* llvmArch; |
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
247 const char *targetTriple; |
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
248 const char *dataLayout; |
159 | 249 }; |
250 | |
251 struct Global | |
252 { | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
253 const char *mars_ext; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
254 const char *sym_ext; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
255 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
|
256 #if _WIN32 |
fd5665da3a27
Hopefully sensible command switch handling. Changed default ext to .o on Windows.
Christian Kamm <kamm incasoftware de>
parents:
699
diff
changeset
|
257 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
|
258 #endif |
159 | 259 char *ll_ext; |
260 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
|
261 char *s_ext; |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
262 const char *lib_ext; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
263 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
|
264 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
|
265 const char *hdr_ext; // for D 'header' import files |
1587 | 266 const char *json_ext; // for JSON files |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
267 const char *copyright; |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
268 const char *written; |
159 | 269 Array *path; // Array of char*'s which form the import lookup path |
270 Array *filePath; // Array of char*'s which form the file import lookup path | |
271 int structalign; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1064
diff
changeset
|
272 const char *version; |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
651
diff
changeset
|
273 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
|
274 char *llvm_version; |
159 | 275 |
276 Param params; | |
277 unsigned errors; // number of errors reported so far | |
278 unsigned gag; // !=0 means gag reporting of errors | |
279 | |
280 Global(); | |
281 }; | |
282 | |
283 extern Global global; | |
284 | |
876
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
285 /* 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
|
286 * Apparently, VC has dropped support for these? |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
287 */ |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
288 #define WINDOWS_SEH (_WIN32 && __DMC__) |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
289 |
27a379f288bf
Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
872
diff
changeset
|
290 |
159 | 291 #ifdef __DMC__ |
292 typedef _Complex long double complex_t; | |
293 #else | |
294 #ifndef IN_GCC | |
295 #include "complex_t.h" | |
296 #endif | |
297 #ifdef __APPLE__ | |
298 //#include "complex.h"//This causes problems with include the c++ <complex> and not the C "complex.h" | |
299 #endif | |
300 #endif | |
301 | |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
302 // 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
|
303 //typedef uint64_t integer_t; |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1170
diff
changeset
|
304 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
|
305 // avoid conflicts with system #include's |
159 | 306 |
307 // Signed and unsigned variants | |
308 typedef int64_t sinteger_t; | |
309 typedef uint64_t uinteger_t; | |
310 | |
311 typedef int8_t d_int8; | |
312 typedef uint8_t d_uns8; | |
313 typedef int16_t d_int16; | |
314 typedef uint16_t d_uns16; | |
315 typedef int32_t d_int32; | |
316 typedef uint32_t d_uns32; | |
317 typedef int64_t d_int64; | |
318 typedef uint64_t d_uns64; | |
319 | |
320 typedef float d_float32; | |
321 typedef double d_float64; | |
322 typedef long double d_float80; | |
323 | |
324 typedef d_uns8 d_char; | |
325 typedef d_uns16 d_wchar; | |
326 typedef d_uns32 d_dchar; | |
327 | |
328 #ifdef IN_GCC | |
329 #include "d-gcc-real.h" | |
330 #else | |
331 typedef long double real_t; | |
332 #endif | |
333 | |
334 // Modify OutBuffer::writewchar to write the correct size of wchar | |
335 #if _WIN32 | |
336 #define writewchar writeword | |
337 #else | |
338 // This needs a configuration test... | |
339 #define writewchar write4 | |
340 #endif | |
341 | |
342 #ifdef IN_GCC | |
343 #include "d-gcc-complex_t.h" | |
344 #endif | |
345 | |
346 struct Module; | |
347 | |
348 //typedef unsigned Loc; // file location | |
349 struct Loc | |
350 { | |
1587 | 351 const char *filename; |
159 | 352 unsigned linnum; |
353 | |
354 Loc() | |
355 { | |
356 linnum = 0; | |
357 filename = NULL; | |
358 } | |
359 | |
360 Loc(int x) | |
361 { | |
362 linnum = x; | |
363 filename = NULL; | |
364 } | |
365 | |
366 Loc(Module *mod, unsigned linnum); | |
367 | |
368 char *toChars() const; | |
1587 | 369 bool equals(const Loc& loc); |
159 | 370 }; |
371 | |
372 #ifndef GCC_SAFE_DMD | |
373 #define TRUE 1 | |
374 #define FALSE 0 | |
375 #endif | |
376 | |
377 #define INTERFACE_OFFSET 0 // if 1, put classinfo as first entry | |
378 // in interface vtbl[]'s | |
379 #define INTERFACE_VIRTUAL 0 // 1 means if an interface appears | |
380 // in the inheritance graph multiple | |
381 // times, only one is used | |
382 | |
383 enum LINK | |
384 { | |
385 LINKdefault, | |
386 LINKd, | |
387 LINKc, | |
388 LINKcpp, | |
389 LINKwindows, | |
390 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
|
391 |
55f6c2e454d7
Implemented correct parameter order according to x86-32 ABI documentation.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
708
diff
changeset
|
392 // LDC |
55f6c2e454d7
Implemented correct parameter order according to x86-32 ABI documentation.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
708
diff
changeset
|
393 LINKintrinsic, |
159 | 394 }; |
395 | |
396 enum DYNCAST | |
397 { | |
398 DYNCAST_OBJECT, | |
399 DYNCAST_EXPRESSION, | |
400 DYNCAST_DSYMBOL, | |
401 DYNCAST_TYPE, | |
402 DYNCAST_IDENTIFIER, | |
403 DYNCAST_TUPLE, | |
404 }; | |
405 | |
406 enum MATCH | |
407 { | |
408 MATCHnomatch, // no match | |
409 MATCHconvert, // match with conversions | |
336 | 410 #if DMDV2 |
159 | 411 MATCHconst, // match with conversion to const |
412 #endif | |
413 MATCHexact // exact match | |
414 }; | |
415 | |
1372
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
416 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
|
417 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
|
418 void error(Loc loc, const char *format, ...) IS_PRINTF(2); |
159 | 419 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
|
420 |
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
421 #ifdef __GNUC__ |
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
422 __attribute__((noreturn)) |
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
423 #endif |
159 | 424 void fatal(); |
1586
7f728c52e63c
Fix several 'reaches end of function' warnings by making fatal noreturn.
Christian Kamm <kamm incasoftware de>
parents:
1482
diff
changeset
|
425 |
159 | 426 void err_nomem(); |
988
2667e3a145be
- Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
986
diff
changeset
|
427 void inifile(char *argv0, const char *inifile); |
159 | 428 void halt(); |
429 | |
430 /*** 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
|
431 #if IN_GCC || IN_LLVM |
159 | 432 #define stdmsg stderr |
433 #else | |
1587 | 434 #define stdmsg stderr |
159 | 435 #endif |
436 | |
437 #endif /* DMD_MARS_H */ |