annotate dmd/Global.d @ 192:eb38fdcb3e62 default tip

updated to compile with dmd2.062
author korDen
date Sat, 02 Mar 2013 01:25:52 -0800
parents cd48cb899aee
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.Global;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 96
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Array;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.Param;
166
d8565fbd755c Moved object and classinfo from ClassDeclaration to Global (as part of getting rid of the global state)
korDen
parents: 138
diff changeset
6 import dmd.ClassDeclaration;
167
50a6d232176c rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents: 166
diff changeset
7 import dmd.DsymbolTable;
168
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
8 import dmd.StringTable;
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
9 import dmd.OutBuffer;
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
10 import dmd.Token;
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
11 import dmd.Scope;
169
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
12 import dmd.Module;
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
13 import dmd.Expression;
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
14 import dmd.Dsymbol;
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
15 import dmd.Type;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
16 import dmd.TypeInfoDeclaration;
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
17 import dmd.Id;
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
18 import dmd.TY;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
19 import dmd.LINK;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
20 import dmd.MOD;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
21 import dmd.Loc;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
22 import dmd.TOK;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
23 import dmd.TypeFunction;
192
eb38fdcb3e62 updated to compile with dmd2.062
korDen
parents: 179
diff changeset
24 import dmd.GlobalExpressions : initGlobalExpressions;
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
25
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
26 import dmd.codegen.Util;
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
27 import dmd.backend.elem;
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
28 import dmd.backend.Classsym;
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
29 import dmd.backend.Symbol;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
30 import dmd.backend.glue;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
31 import dmd.backend.iasm;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
32 import dmd.backend.StringTab;
169
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
33
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
34 import core.stdc.time;
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
35 import core.stdc.stdio;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
37 import dmd.TObject;
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
38
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
39 class Global : TObject
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 string mars_ext = "d";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 string sym_ext = "d";
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
43
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 version (TARGET_WINDOS) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 string obj_ext = "obj";
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
46 } else version (POSIX) { // TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 string obj_ext = "o";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 } else version (TARGET_NET) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 static assert (false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
53 version (TARGET_WINDOS) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 string lib_ext = "lib";
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
55 } else version (POSIX) { // TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56 string lib_ext = "a";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 } else version (TARGET_NET) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59 static assert (false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60 }
79
43073c7c7769 updated to 2.035
Trass3r
parents: 75
diff changeset
61 string doc_ext = "html"; // for Ddoc generated files
43073c7c7769 updated to 2.035
Trass3r
parents: 75
diff changeset
62 string ddoc_ext = "ddoc"; // for Ddoc macro include files
43073c7c7769 updated to 2.035
Trass3r
parents: 75
diff changeset
63 string json_ext = "json";
179
cd48cb899aee Updated to dmd2.040
korDen
parents: 178
diff changeset
64 string map_ext = "map"; // for .map files
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 string hdr_ext = "di"; // for D 'header' import files
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 string copyright= "Copyright (c) 1999-2009 by Digital Mars";
75
cfa3747ebe4c Changed dmd to ddmd in the "usage" message and added "ported to D by community" to desription to distinguish from pure dmd build
korDen
parents: 73
diff changeset
67 string written = "written by Walter Bright, ported to D by community";
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 ///version (TARGET_NET) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 /// "\nMSIL back-end (alpha release) by Cristian L. Vlasceanu and associates.";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 ///}
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
71
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 string[] path; // Array of char*'s which form the import lookup path
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 string[] filePath; // Array of char*'s which form the file import lookup path
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 int structalign = 8;
179
cd48cb899aee Updated to dmd2.040
korDen
parents: 178
diff changeset
75 string version_ = "v2.040";
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
77 Param params;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
78 uint errors; // number of errors reported so far
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
79 uint gag; // !=0 means gag reporting of errors
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
80
166
d8565fbd755c Moved object and classinfo from ClassDeclaration to Global (as part of getting rid of the global state)
korDen
parents: 138
diff changeset
81 ClassDeclaration object;
d8565fbd755c Moved object and classinfo from ClassDeclaration to Global (as part of getting rid of the global state)
korDen
parents: 138
diff changeset
82 ClassDeclaration classinfo;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
83
167
50a6d232176c rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents: 166
diff changeset
84 // Used in FuncDeclaration.genCfunc()
50a6d232176c rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents: 166
diff changeset
85 DsymbolTable st;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
86
168
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
87 // Used in Lexer.uniqueId()
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
88 int num;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
89
168
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
90 // Used in Identifier.generateId()
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
91 size_t i;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
92
168
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
93 // Used in Lexer
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
94 StringTable stringtable;
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
95 OutBuffer stringbuffer;
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
96 Token* freelist;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
97
169
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
98 char date[11+1];
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
99 char time[8+1];
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
100 char timestamp[24+1];
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
101
169
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
102 // Used in Module
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
103 Module rootModule;
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
104 DsymbolTable modules; // symbol table of all modules
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
105 Array amodules; // array of all modules
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
106 Array deferred; // deferred Dsymbol's needing semantic() run on them
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
107 uint dprogress; // progress resolving the deferred list
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
108 int nested;
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
109 Classsym* scc;
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
110 ClassDeclaration moduleinfo;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
111
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
112 // Used in PowExp
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
113 bool importMathChecked = false;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
114
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
115 // Used in Scope
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
116 Scope scope_freelist;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
117
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
118 // Used in TemplateMixin
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
119 int nest;
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
120
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
121 // Used in Type
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
122 StringTable type_stringtable;
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
123
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
124 Type tvoidptr; // void*
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
125 Type tstring; // immutable(char)[]
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
126
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
127 ClassDeclaration typeinfo;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
128 ClassDeclaration typeinfoclass;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
129 ClassDeclaration typeinfointerface;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
130 ClassDeclaration typeinfostruct;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
131 ClassDeclaration typeinfotypedef;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
132 ClassDeclaration typeinfopointer;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
133 ClassDeclaration typeinfoarray;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
134 ClassDeclaration typeinfostaticarray;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
135 ClassDeclaration typeinfoassociativearray;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
136 ClassDeclaration typeinfoenum;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
137 ClassDeclaration typeinfofunction;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
138 ClassDeclaration typeinfodelegate;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
139 ClassDeclaration typeinfotypelist;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
140 ClassDeclaration typeinfoconst;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
141 ClassDeclaration typeinfoinvariant;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
142 ClassDeclaration typeinfoshared;
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 173
diff changeset
143 ClassDeclaration typeinfowild;
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
144
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
145 Type basic[TY.TMAX];
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
146 TypeInfoDeclaration internalTI[TMAX];
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
147
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
148 // Used in BinExp
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
149 StringTable arrayfuncs;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
150
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
151 // Used in FuncDeclaration
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
152 int hiddenparami; // how many we've generated so far
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
153
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
154 // Used in TypeAArray
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
155 // Dumb linear symbol table - should use associative array!
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
156 Array sarray;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
157 Symbol* AArray_s;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
158
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
159 // Used in TypeDelegate
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
160 Symbol* Delegate_s;
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
161
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
162 // Used in TypeInfoStructDeclaration
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
163 TypeFunction tftohash;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
164 TypeFunction tftostring;
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
165
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
166 // Used in backend.glue
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
167 Array obj_symbols_towrite;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
168 Outbuffer objbuf;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
169 string lastmname;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
170 int count;
179
cd48cb899aee Updated to dmd2.040
korDen
parents: 178
diff changeset
171 elem* esharedctor;
cd48cb899aee Updated to dmd2.040
korDen
parents: 178
diff changeset
172 Array esharedctorgates;
cd48cb899aee Updated to dmd2.040
korDen
parents: 178
diff changeset
173 elem* eshareddtor;
cd48cb899aee Updated to dmd2.040
korDen
parents: 178
diff changeset
174 int shareddtorcount;
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
175
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
176 // Used in backend.iasm
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
177 ASM_STATE asmstate;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
178 Token* asmtok;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
179 TOK tok_value;
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
180
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
181 // Used in backend.StringTab
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
182 StringTab[STSIZE] stringTab;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
183 size_t stidx;
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
184
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
185 // Used in backend.Util
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
186 elem* eictor;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
187 Symbol* ictorlocalgot;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
188 elem* ector;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
189 Array ectorgates;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
190 elem* edtor;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
191 elem* etest;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
192 int dtorcount;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
193 Symbol* localgot;
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
194
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
195 Dsymbol sdummy;
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
196 Expression edummy;
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
197
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
198 this()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
199 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
200 register();
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
201
192
eb38fdcb3e62 updated to compile with dmd2.062
korDen
parents: 179
diff changeset
202 initGlobalExpressions();
eb38fdcb3e62 updated to compile with dmd2.062
korDen
parents: 179
diff changeset
203
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
204 params.versionids = new Vector!(string)();
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
205 params.imppath = new Array();
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
206
167
50a6d232176c rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents: 166
diff changeset
207 st = new DsymbolTable();
168
ceed63f310fb stringtable, stringbuffer and freelist moved to Global
korDen
parents: 167
diff changeset
208 stringbuffer = new OutBuffer();
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
209
169
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
210 modules = new DsymbolTable();
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
211 amodules = new Array();
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
212 deferred = new Array();
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
213
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
214 sarray = new Array();
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
215
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
216 obj_symbols_towrite = new Array();
176
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
217
fa9a71a9f5a8 Moved all the mutable globals to Global
korDen
parents: 174
diff changeset
218 ectorgates = new Array();
179
cd48cb899aee Updated to dmd2.040
korDen
parents: 178
diff changeset
219 esharedctorgates = new Array();
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
220
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
221 sdummy = new Dsymbol();
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
222 edummy = new Expression(Loc(0), TOK.init, 0);
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
223
169
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
224 init_time();
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
225 }
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
226
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
227 void initClasssym()
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
228 {
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
229 scc = fake_classsym(Id.ClassInfo);
178
e3afd1303184 Many small bugs fixed
korDen
parents: 177
diff changeset
230
177
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
231 scope Scope sc = new Scope();
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
232
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
233 tftohash = new TypeFunction(null, Type.thash_t, 0, LINK.LINKd);
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
234 tftohash.mod = MOD.MODconst;
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
235 tftohash = cast(TypeFunction)tftohash.semantic(Loc(0), sc);
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
236
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
237 tftostring = new TypeFunction(null, Type.tchar.invariantOf().arrayOf(), 0, LINK.LINKd);
1475fd394c9e bug fixes
korDen
parents: 176
diff changeset
238 tftostring = cast(TypeFunction)tftostring.semantic(Loc(0), sc);
170
96c0fff6897d more global state cleanup
korDen
parents: 169
diff changeset
239 }
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
240
169
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
241 void init_time()
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
242 {
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
243 time_t tm;
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
244 char* p;
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
245
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
246 .time(&tm);
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
247 p = ctime(&tm);
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
248 assert(p);
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
249 sprintf(date.ptr, "%.6s %.4s", p + 4, p + 20);
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
250 sprintf(time.ptr, "%.8s", p + 11);
e7769d53e750 Moves static variables from Module to Global
korDen
parents: 168
diff changeset
251 sprintf(timestamp.ptr, "%.24s", p);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
252 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
253 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
254
173
d237b38b5858 Small changes
korDen
parents: 170
diff changeset
255 __gshared Global global;