annotate dmd/backend/Config.d @ 114:e28b18c23469

added a module dmd.common for commonly used stuff it currently holds code for consistency checking of predefined versions also added a VisualD project file
author Trass3r
date Wed, 01 Sep 2010 18:21:58 +0200
parents 3f834bed4f13
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.backend.Config;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 25
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.backend.LINKAGE;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.EnumUtils;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 extern (C) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 void cod3_set64();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 void cod3_set386();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11
25
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
12
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
13 debug {
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
14
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
15 version (Windows) {
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
16 extern (C++) extern
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
17 {
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
18 __gshared char debuga; /* cg - watch assignaddr() */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
19 __gshared char debugb; /* watch block optimization */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
20 __gshared char debugc; /* watch code generated */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
21 __gshared char debugd; /* watch debug information generated */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
22 __gshared char debuge; // dump eh info
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
23 __gshared char debugf; /* trees after dooptim */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
24 __gshared char debugg; /* trees for code generator */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
25 __gshared char debugo; // watch optimizer
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
26 __gshared char debugr; // watch register allocation
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
27 __gshared char debugs; /* watch common subexp eliminator */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
28 __gshared char debugt; /* do test points */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
29 __gshared char debugu;
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
30 __gshared char debugw; /* watch progress */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
31 __gshared char debugx; /* suppress predefined CPP stuff */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
32 __gshared char debugy; /* watch output to il buffer */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
33 }
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
34 } else {
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
35 extern (C) extern
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
36 {
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
37 __gshared char debuga; /* cg - watch assignaddr() */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
38 __gshared char debugb; /* watch block optimization */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
39 __gshared char debugc; /* watch code generated */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
40 __gshared char debugd; /* watch debug information generated */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
41 __gshared char debuge; // dump eh info
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
42 __gshared char debugf; /* trees after dooptim */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
43 __gshared char debugg; /* trees for code generator */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
44 __gshared char debugo; // watch optimizer
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
45 __gshared char debugr; // watch register allocation
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
46 __gshared char debugs; /* watch common subexp eliminator */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
47 __gshared char debugt; /* do test points */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
48 __gshared char debugu;
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
49 __gshared char debugw; /* watch progress */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
50 __gshared char debugx; /* suppress predefined CPP stuff */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
51 __gshared char debugy; /* watch output to il buffer */
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
52 }
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
53 }
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
54
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 // This part of the configuration is saved in the precompiled header for use
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 // in comparing to make sure it hasn't changed.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60 enum CFG2
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 CFG2comdat = 1, // use initialized common blocks
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63 CFG2nodeflib = 2, // no default library imbedded in OBJ file
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64 CFG2browse = 4, // generate browse records
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 CFG2dyntyping = 8, // generate dynamic typing information
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 CFG2fulltypes = 0x10, // don't optimize CV4 class info
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67 CFG2warniserr = 0x20, // treat warnings as errors
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 CFG2phauto = 0x40, // automatic precompiled headers
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 CFG2phuse = 0x80, // use precompiled headers
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 CFG2phgen = 0x100, // generate precompiled header
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 CFG2once = 0x200, // only include header files once
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 CFG2hdrdebug = 0x400, // generate debug info for header
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 CFG2phautoy = 0x800, // fast build precompiled headers
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 CFG2noobj = 0x1000, // we are not generating a .OBJ file
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
75 CFG2noerrmax = 0x4000, // no error count maximum
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76 CFG2expand = 0x8000, // expanded output to list file
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
77 CFG2seh = 0x10000, // use Win32 SEH to support any exception handling
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
78 CFGX2 = (CFG2warniserr | CFG2phuse | CFG2phgen | CFG2phauto | CFG2once | CFG2hdrdebug | CFG2noobj | CFG2noerrmax | CFG2expand | CFG2nodeflib),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
79 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
80
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
81 enum CFG3ju = 1; // char == unsigned char
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
82 enum CFG3eh = 4; // generate exception handling stuff
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 enum CFG3strcod = 8; // strings are placed in code segment
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84 enum CFG3eseqds = 0x10; // ES == DS at all times
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85 enum CFG3ptrchk = 0x20; // generate pointer validation code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86 enum CFG3strictproto = 0x40; // strict prototyping
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 enum CFG3autoproto = 0x80; // auto prototyping
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88 enum CFG3rtti = 0x100; // add RTTI support
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
89 enum CFG3relax = 0x200; // relaxed type checking (C only)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90 enum CFG3cpp = 0x400; // C++ compile
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
91 enum CFG3igninc = 0x800; // ignore standard include directory
22
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
92 version (POSIX) {///TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS) {
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
93 enum CFG3mars = 0x1000; // use mars libs and headers
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
94 enum NO_FAR = true; // always ignore __far and __huge keywords
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
95 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
96 enum CFG3nofar = 0x1000; // ignore __far and __huge keywords
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
97 ///enum NO_FAR = (config.flags3 & CFG3nofar);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
98 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
99 enum CFG3noline = 0x2000; // do not output #line directives
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
100 enum CFG3comment = 0x4000; // leave comments in preprocessed output
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
101 enum CFG3cppcomment = 0x8000; // allow C++ style comments
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
102 enum CFG3wkfloat = 0x10000; // make floating point references weak externs
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
103 enum CFG3digraphs = 0x20000; // support ANSI C++ digraphs
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
104 ///#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
105 enum CFG3semirelax = 0x40000; // moderate relaxed type checking
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
106 ///#endif
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
107 enum CFG3pic = 0x80000; // position independent code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
108 enum CFGX3 = (CFG3strcod | CFG3ptrchk);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
109
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
110 enum CFG4speed = 1; // optimized for speed
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
111 enum CFG4space = 2; // optimized for space
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
112 enum CFG4optimized = (CFG4speed | CFG4space);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
113 enum CFG4allcomdat = 4; // place all functions in COMDATs
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
114 enum CFG4fastfloat = 8; // fast floating point (-ff)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
115 enum CFG4fdivcall = 0x10; // make function call for FDIV opcodes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
116 enum CFG4tempinst = 0x20; // instantiate templates for undefined functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
117 enum CFG4oldstdmangle = 0x40; // do stdcall mangling without @
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
118 enum CFG4pascal = 0x80; // default to pascal linkage
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
119 enum CFG4stdcall = 0x100; // default to std calling convention
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
120 enum CFG4cacheph = 0x200; // cache precompiled headers in memory
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
121 enum CFG4alternate = 0x400; // if alternate digraph tokens
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
122 enum CFG4bool = 0x800; // support 'bool' as basic type
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
123 enum CFG4wchar_t = 0x1000; // support 'wchar_t' as basic type
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
124 enum CFG4notempexp = 0x2000; // no instantiation of template functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
125 enum CFG4anew = 0x4000; // allow operator new[] and delete[] overloading
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
126 enum CFG4oldtmangle = 0x8000; // use old template name mangling
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
127 enum CFG4dllrtl = 0x10000; // link with DLL RTL
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
128 enum CFG4noemptybaseopt = 0x40000; // turn off empty base class optimization
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
129 enum CFG4stackalign = CFG4speed; // align stack to 8 bytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
130 enum CFG4nowchar_t = 0x80000; // use unsigned short name mangling for wchar_t
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
131 enum CFG4forscope = 0x100000; // new C++ for scoping rules
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 enum CFG4warnccast = 0x200000; // warn about C style casts
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
133 enum CFG4adl = 0x400000; // argument dependent lookup
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134 enum CFG4enumoverload = 0x800000; // enum overloading
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135 enum CFG4implicitfromvoid = 0x1000000; // allow implicit cast from void* to T*
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
136 enum CFG4dependent = 0x2000000; // dependent / non-dependent lookup
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137 enum CFG4wchar_is_long = 0x4000000; // wchar_t is 4 bytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
138 enum CFG4underscore = 0x8000000; // prepend _ for C mangling
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
139 enum CFGX4 = (CFG4optimized | CFG4fastfloat | CFG4fdivcall | CFG4tempinst | CFG4cacheph | CFG4notempexp | CFG4stackalign | CFG4dependent);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
140 enum CFGY4 = (CFG4nowchar_t | CFG4noemptybaseopt | CFG4adl | CFG4enumoverload | CFG4implicitfromvoid | CFG4wchar_is_long | CFG4underscore);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
141
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
142 mixin(BringToCurrentScope!(CFG2));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
143
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
144 enum TARGET
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
145 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
146 TARGET_8086= 0,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
147 TARGET_80286= 2,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
148 TARGET_80386= 3,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
149 TARGET_80486= 4,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
150 TARGET_Pentium= 5,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
151 TARGET_PentiumMMX= 6,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
152 TARGET_PentiumPro= 7,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
153 TARGET_PentiumII= 8,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
154 TARGET_AMD64= 9, //(32 or 64 bit mode)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
155 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
156
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
157 mixin(BringToCurrentScope!(TARGET));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
158
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
159 struct Config
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
160 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
161 char language; // 'C' = C, 'D' = C++
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
162 //#define CPP (config.language == 'D')
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
163 char version_[8]; // = VERSION
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
164 char exetype[3]; // distinguish exe types so PH
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
165 // files are distinct (= SUFFIX)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
166
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167 char target_cpu; // instruction selection
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
168 char target_scheduler; // instruction scheduling (normally same as selection)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170 short versionint; // intermediate file version (= VERSIONINT)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
171 int defstructalign; // struct alignment specified by command line
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172 short hxversion; // HX version number
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 char fulltypes;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
174 uint wflags; // flags for Windows code generation
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
175
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
176 char inline8087; /* 0: emulator
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177 1: IEEE 754 inline 8087 code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178 2: fast inline 8087 code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180 short memmodel; // 0:S,X,N,F, 1:M, 2:C, 3:L, 4:V
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
181 uint exe; // target operating system
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
182
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
183 ///#define EX_flat (EX_OS2 | EX_NT | EX_LINUX | EX_WIN64 | EX_LINUX64 | \
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
184 /// EX_OSX | EX_OSX64 | EX_FREEBSD | EX_FREEBSD64 | \
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
185 /// EX_SOLARIS | EX_SOLARIS64)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
186 ///#define EX_dos (EX_DOSX | EX_ZPM | EX_RATIONAL | EX_PHARLAP | \
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
187 /// EX_COM | EX_MZ /*| EX_WIN16*/)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
188
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
189 /* CFGX: flags ignored in precompiled headers
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
190 * CFGY: flags copied from precompiled headers into current config
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
191 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
192 uint flags;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
193 uint flags2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
194 uint flags3;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
195 uint flags4;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
196 uint flags5;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
197 ///#define CFG5debug 1 // compile in __debug code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
198 ///#define CFG5in 2 // compile in __in code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
199 ///#define CFG5out 4 // compile in __out code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
200 ///#define CFG5invariant 8 // compile in __invariant code
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
201
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
202 ///#if HTOD
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
203 /// unsigned htodFlags; // configuration for htod
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
204 ///#define HTODFinclude 1 // -hi drill down into #include files
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
205 ///#define HTODFsysinclude 2 // -hs drill down into system #include files
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
206 ///#define HTODFtypedef 4 // -ht drill down into typedefs
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
207 ///#define HTODFcdecl 8 // -hc skip C declarations as comments
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
208 ///#endif
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
209 char ansi_c; // strict ANSI C
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
210 // 89 for ANSI C89, 99 for ANSI C99
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
211 char asian_char; /* 0: normal, 1: Japanese, 2: Chinese */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
212 /* and Taiwanese, 3: Korean */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
213 uint threshold; // data larger than threshold is assumed to
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
214 // be far (16 bit models only)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
215 ///#define THRESHMAX 0xFFFF // if threshold == THRESHMAX, all data defaults
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
216 // to near
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
217 LINKAGE linkage; // default function call linkage
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
218 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
219
25
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
220 version (Windows) {
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
221 extern (C++) extern __gshared Config config;
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
222 } else {
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
223 extern (C) extern __gshared Config config;
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
224 }
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
225
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
226 enum CVNONE = 0; // No symbolic info
22
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
227 enum CVOLD = 1; // Codeview 1 symbolic info
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
228 enum CV4 = 2; // Codeview 4 symbolic info
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
229 enum CVSYM = 3; // Symantec format
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
230 enum CVTDB = 4; // Symantec format written to file
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
231 enum CVDWARF_C = 5; // Dwarf in C format
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
232 enum CVDWARF_D = 6; // Dwarf in D format
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
233 enum CVSTABS = 7; // Elf Stabs in C format
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
234
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
235 enum CFGuchar = 1; // chars are unsigned
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
236 enum CFGsegs = 2; // new code seg for each far func
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
237 enum CFGtrace = 4; // output trace functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
238 enum CFGglobal = 8; // make all static functions global
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
239 enum CFGstack = 0x20; // add stack overflow checking
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
240 enum CFGalwaysframe = 0x40; // always generate stack frame
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
241 enum CFGnoebp = 0x80; // do not use EBP as general purpose register
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
242 enum CFGromable = 0x100; // put switch tables in code segment
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
243 enum CFGeasyomf = 0x200; // generate Pharlap Easy-OMF format
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
244 enum CFGfarvtbls = 0x800; // store vtables in far segments
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
245 enum CFGnoinlines = 0x1000; // do not inline functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
246 enum CFGnowarning = 0x8000; // disable warnings
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
247 enum CFGX = (CFGnowarning);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
248
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
249 enum EX_DOSX = 1; // DOSX 386 program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
250 enum EX_ZPM = 2; // ZPM 286 program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
251 enum EX_RATIONAL = 4; // RATIONAL 286 program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
252 enum EX_PHARLAP = 8; // PHARLAP 386 program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
253 enum EX_COM = 0x10; // MSDOS .COM program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
254 //#define EX_WIN16 0x20 // Windows 3.x 16 bit program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
255 enum EX_OS2 = 0x40; // OS/2 2.0 32 bit program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
256 enum EX_OS1 = 0x80; // OS/2 1.x 16 bit program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
257 enum EX_NT = 0x100; // NT
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
258 enum EX_MZ = 0x200; // MSDOS real mode program
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
259 enum EX_XENIX = 0x400;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
260 enum EX_SCOUNIX = 0x800;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
261 enum EX_UNIXSVR4 = 0x1000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
262 enum EX_LINUX = 0x2000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
263 enum EX_WIN64 = 0x4000; // AMD64 and Windows (64 bit mode)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
264 enum EX_LINUX64 = 0x8000; // AMD64 and Linux (64 bit mode)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
265 enum EX_OSX = 0x10000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
266 enum EX_OSX64 = 0x20000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
267 enum EX_FREEBSD = 0x40000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
268 enum EX_FREEBSD64 = 0x80000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
269 enum EX_SOLARIS = 0x100000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
270 enum EX_SOLARIS64 = 0x200000;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
271
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
272 enum WFwindows = 1; // generating code for Windows app or DLL
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
273 enum WFdll = 2; // generating code for Windows DLL
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
274 enum WFincbp = 4; // mark far stack frame with inc BP / dec BP
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
275 enum WFloadds = 8; // assume __loadds for all functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
276 enum WFexpdef = 0x10; // generate export definition records for
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
277 // exported functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
278 enum WFss = 0x20; // load DS from SS
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
279 enum WFreduced = 0x40; // skip DS load for non-exported functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
280 enum WFdgroup = 0x80; // load DS from DGROUP
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
281 enum WFexport = 0x100; // assume __export for all far functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
282 enum WFds = 0x200; // load DS from DS
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
283 enum WFmacros = 0x400; // define predefined windows macros
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
284 enum WFssneds = 0x800; // SS != DS
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
285 enum WFthunk = 0x1000; // use fixups instead of direct ref to CS
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
286 enum WFsaveds = 0x2000; // use push/pop DS for far functions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
287 enum WFdsnedgroup = 0x4000; // DS != DGROUP
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
288 enum WFexe = 0x8000; // generating code for Windows EXE