annotate dmd/Global.d @ 179:cd48cb899aee

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