annotate dmd/Global.d @ 177:1475fd394c9e

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