Mercurial > projects > ddmd
annotate dmd/TypeFunction.d @ 131:206db751bd4c
dmdfe 2.037 compiles now
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Fri, 10 Sep 2010 00:27:37 +0100 |
parents | 60bb0fe4563e |
children | c494af1dba80 |
rev | line source |
---|---|
0 | 1 module dmd.TypeFunction; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.TypeNext; |
5 import dmd.TypeSArray; | |
6 import dmd.TypeArray; | |
123 | 7 import dmd.TemplateTupleParameter; |
0 | 8 import dmd.ArrayTypes; |
9 import dmd.LINK; | |
10 import dmd.StructDeclaration; | |
11 import dmd.TypeStruct; | |
12 import dmd.Global; | |
13 import dmd.STC; | |
14 import dmd.MOD; | |
73 | 15 import dmd.PROT; |
123 | 16 import dmd.TypeIdentifier; |
17 import dmd.TemplateParameter; | |
129 | 18 import dmd.TypeInfoFunctionDeclaration; |
123 | 19 import dmd.Tuple; |
0 | 20 import dmd.Type; |
21 import dmd.Loc; | |
22 import dmd.Scope; | |
23 import dmd.Identifier; | |
24 import dmd.OutBuffer; | |
25 import dmd.HdrGenState; | |
26 import dmd.CppMangleState; | |
27 import dmd.TypeInfoDeclaration; | |
28 import dmd.MATCH; | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
29 import dmd.Parameter; |
0 | 30 import dmd.Expression; |
31 import dmd.RET; | |
32 import dmd.TY; | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
33 import dmd.TRUST; |
0 | 34 import dmd.Util; |
131
206db751bd4c
dmdfe 2.037 compiles now
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
130
diff
changeset
|
35 import dmd.FuncDeclaration; |
206db751bd4c
dmdfe 2.037 compiles now
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
130
diff
changeset
|
36 import dmd.Dsymbol; |
123 | 37 import dmd.TemplateInstance : isTuple; |
0 | 38 |
39 import dmd.backend.TYPE; | |
40 import dmd.backend.PARAM; | |
41 import dmd.backend.Util; | |
42 import dmd.backend.TYM; | |
43 import dmd.backend.TF; | |
44 import dmd.backend.mTY; | |
45 | |
46 import core.stdc.stdlib; | |
47 import core.stdc.string; | |
48 | |
129 | 49 import std.stdio; |
50 | |
0 | 51 class TypeFunction : TypeNext |
52 { | |
53 // .next is the return type | |
54 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
55 Parameters parameters; // function parameters |
0 | 56 int varargs; // 1: T t, ...) style for variable number of arguments |
57 // 2: T t ...) style for variable number of arguments | |
58 bool isnothrow; // true: nothrow | |
59 bool ispure; // true: pure | |
60 bool isproperty; // can be called without parentheses | |
61 bool isref; // true: returns a reference | |
62 LINK linkage; // calling convention | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
63 TRUST trust; // level of trust |
0 | 64 |
65 int inuse; | |
66 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
67 this(Parameters parameters, Type treturn, int varargs, LINK linkage) |
0 | 68 { |
69 super(TY.Tfunction, treturn); | |
70 | |
71 //if (!treturn) *(char*)0=0; | |
72 // assert(treturn); | |
73 assert(0 <= varargs && varargs <= 2); | |
74 this.parameters = parameters; | |
75 this.varargs = varargs; | |
76 this.linkage = linkage; | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
77 this.trust = TRUSTdefault; |
0 | 78 } |
79 | |
72 | 80 override Type syntaxCopy() |
0 | 81 { |
82 Type treturn = next ? next.syntaxCopy() : null; | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
83 auto params = Parameter.arraySyntaxCopy(parameters); |
0 | 84 TypeFunction t = new TypeFunction(params, treturn, varargs, linkage); |
85 t.mod = mod; | |
86 t.isnothrow = isnothrow; | |
87 t.ispure = ispure; | |
88 t.isproperty = isproperty; | |
89 t.isref = isref; | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
90 t.trust = trust; |
0 | 91 |
92 return t; | |
93 } | |
94 | |
95 version (DumbClone) { | |
96 } else { | |
97 final TypeFunction cloneTo(TypeFunction t) | |
98 { | |
99 super.cloneTo(t); | |
100 | |
101 // these 3 should be set by ctor | |
102 assert(t.parameters is null); | |
103 assert(t.varargs == varargs); | |
104 assert(t.linkage == linkage); | |
105 | |
106 t.isnothrow = isnothrow; | |
107 t.ispure = ispure; | |
108 t.isproperty = isproperty; | |
109 t.isref = isref; | |
110 t.inuse = inuse; | |
111 | |
112 if (parameters) | |
113 { | |
114 t.parameters = parameters.copy(); | |
129 | 115 foreach (arg; parameters) |
0 | 116 { |
117 Argument cpy = arg.clone(); | |
129 | 118 t.parameters[i] = cpy; |
0 | 119 } |
120 } | |
121 | |
122 return t; | |
123 } | |
124 | |
125 TypeFunction clone() | |
126 { | |
129 | 127 assert(this.classinfo is TypeFunction.classinfo); |
0 | 128 return cloneTo(new TypeFunction(null, next, varargs, linkage)); |
129 } | |
130 } | |
72 | 131 override Type semantic(Loc loc, Scope sc) |
0 | 132 { |
133 if (deco) // if semantic() already run | |
134 { | |
135 //printf("already done\n"); | |
136 return this; | |
137 } | |
138 //printf("TypeFunction.semantic() this = %p\n", this); | |
139 //printf("TypeFunction.semantic() %s, sc.stc = %x\n", toChars(), sc.stc); | |
140 | |
141 /* Copy in order to not mess up original. | |
142 * This can produce redundant copies if inferring return type, | |
143 * as semantic() will get called again on this. | |
144 */ | |
145 | |
129 | 146 TypeFunction tf = cloneThis(this); |
0 | 147 |
148 if (sc.stc & STC.STCpure) | |
149 tf.ispure = true; | |
150 if (sc.stc & STC.STCnothrow) | |
151 tf.isnothrow = true; | |
152 if (sc.stc & STC.STCref) | |
153 tf.isref = true; | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
154 if (sc.stc & STCsafe) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
155 tf.trust = TRUST.TRUSTsafe; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
156 if (sc.stc & STCtrusted) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
157 tf.trust = TRUST.TRUSTtrusted; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
158 if (sc.stc & STCproperty) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
159 tf.isproperty = true; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
160 |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
161 tf.linkage = sc.linkage; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
162 |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
163 /* If the parent is @safe, then this function defaults to safe |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
164 * too. |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
165 */ |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
166 if (tf.trust == TRUST.TRUSTdefault) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
167 for (Dsymbol p = sc.func; p; p = p.toParent2()) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
168 { FuncDeclaration fd = p.isFuncDeclaration(); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
169 if (fd) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
170 { |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
171 if (fd.isSafe()) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
172 tf.trust = TRUST.TRUSTsafe; // default to @safe |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
173 break; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
174 } |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
175 } |
0 | 176 |
177 if (tf.next) | |
178 { | |
179 tf.next = tf.next.semantic(loc,sc); | |
96 | 180 version(SARRAYVALUE) {} else |
181 { | |
0 | 182 if (tf.next.toBasetype().ty == TY.Tsarray) |
129 | 183 { |
184 error(loc, "functions cannot return static array %s", tf.next.toChars()); | |
0 | 185 tf.next = Type.terror; |
186 } | |
96 | 187 } |
0 | 188 if (tf.next.toBasetype().ty == TY.Tfunction) |
129 | 189 { |
190 error(loc, "functions cannot return a function"); | |
0 | 191 tf.next = Type.terror; |
192 } | |
193 if (tf.next.toBasetype().ty == TY.Ttuple) | |
129 | 194 { |
195 error(loc, "functions cannot return a tuple"); | |
0 | 196 tf.next = Type.terror; |
197 } | |
198 if (tf.next.isauto() && !(sc.flags & SCOPE.SCOPEctor)) | |
129 | 199 error(loc, "functions cannot return scope %s", tf.next.toChars()); |
0 | 200 } |
201 | |
202 if (tf.parameters) | |
73 | 203 { |
204 /* Create a scope for evaluating the default arguments for the parameters | |
205 */ | |
206 Scope argsc = sc.push(); | |
207 argsc.stc = STCundefined; // don't inherit storage class | |
208 argsc.protection = PROT.PROTpublic; | |
209 | |
131
206db751bd4c
dmdfe 2.037 compiles now
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
130
diff
changeset
|
210 size_t dim = Parameter.dim(tf.parameters); |
0 | 211 |
212 for (size_t i = 0; i < dim; i++) | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
213 { auto arg = Parameter.getNth(tf.parameters, i); |
0 | 214 |
215 tf.inuse++; | |
73 | 216 arg.type = arg.type.semantic(loc, argsc); |
0 | 217 if (tf.inuse == 1) tf.inuse--; |
218 | |
219 arg.type = arg.type.addStorageClass(arg.storageClass); | |
220 | |
221 if (arg.storageClass & (STC.STCauto | STC.STCalias | STC.STCstatic)) | |
222 { | |
223 if (!arg.type) | |
224 continue; | |
225 } | |
226 | |
227 Type t = arg.type.toBasetype(); | |
228 | |
229 if (arg.storageClass & (STC.STCout | STC.STCref | STC.STClazy)) | |
230 { | |
96 | 231 //if (t.ty == TY.Tsarray) |
232 //error(loc, "cannot have out or ref parameter of type %s", t.toChars()); | |
233 if (arg.storageClass & STC.STCout && arg.type.mod & (STCconst | STCimmutable)) | |
234 error(loc, "cannot have const or immutabl out parameter of type %s", t.toChars()); | |
0 | 235 } |
236 if (!(arg.storageClass & STC.STClazy) && t.ty == TY.Tvoid) | |
237 error(loc, "cannot have parameter of type %s", arg.type.toChars()); | |
238 | |
239 if (arg.defaultArg) | |
240 { | |
73 | 241 arg.defaultArg = arg.defaultArg.semantic(argsc); |
242 arg.defaultArg = resolveProperties(argsc, arg.defaultArg); | |
243 arg.defaultArg = arg.defaultArg.implicitCastTo(argsc, arg.type); | |
0 | 244 } |
245 | |
246 /* If arg turns out to be a tuple, the number of parameters may | |
247 * change. | |
248 */ | |
249 if (t.ty == TY.Ttuple) | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
250 { dim = Parameter.dim(tf.parameters); |
0 | 251 i--; |
252 } | |
253 } | |
73 | 254 argsc.pop(); |
0 | 255 } |
256 if (tf.next) | |
257 tf.deco = tf.merge().deco; | |
258 | |
259 if (tf.inuse) | |
260 { error(loc, "recursive type"); | |
261 tf.inuse = 0; | |
262 return terror; | |
263 } | |
264 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
265 if (tf.isproperty && (tf.varargs || Parameter.dim(tf.parameters) > 1)) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
266 error(loc, "properties can only have zero or one parameter"); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
267 |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
268 if (tf.varargs == 1 && tf.linkage != LINK.LINKd && Parameter.dim(tf.parameters) == 0) |
0 | 269 error(loc, "variadic functions with non-D linkage must have at least one parameter"); |
270 | |
271 /* Don't return merge(), because arg identifiers and default args | |
272 * can be different | |
273 * even though the types match | |
274 */ | |
275 return tf; | |
276 } | |
277 | |
72 | 278 override void toDecoBuffer(OutBuffer buf, int flag) |
0 | 279 { |
280 ubyte mc; | |
281 | |
282 //printf("TypeFunction.toDecoBuffer() this = %p %s\n", this, toChars()); | |
283 //static int nest; if (++nest == 50) *(char*)0=0; | |
284 if (inuse) | |
285 { | |
286 inuse = 2; // flag error to caller | |
287 return; | |
288 } | |
289 inuse++; | |
290 static if (true) { | |
291 if (mod & MOD.MODshared) | |
292 buf.writeByte('O'); | |
293 if (mod & MOD.MODconst) | |
294 buf.writeByte('x'); | |
295 else if (mod & MOD.MODinvariant) | |
296 buf.writeByte('y'); | |
297 } | |
298 switch (linkage) | |
299 { | |
300 case LINK.LINKd: mc = 'F'; break; | |
301 case LINK.LINKc: mc = 'U'; break; | |
302 case LINK.LINKwindows: mc = 'W'; break; | |
303 case LINK.LINKpascal: mc = 'V'; break; | |
304 case LINK.LINKcpp: mc = 'R'; break; | |
305 } | |
306 buf.writeByte(mc); | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
307 if (ispure || isnothrow || isproperty || isref || trust) |
0 | 308 { |
309 if (ispure) | |
310 buf.writestring("Na"); | |
311 if (isnothrow) | |
312 buf.writestring("Nb"); | |
313 if (isref) | |
314 buf.writestring("Nc"); | |
315 if (isproperty) | |
316 buf.writestring("Nd"); | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
317 switch (trust) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
318 { |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
319 case TRUST.TRUSTtrusted: |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
320 buf.writestring("Ne"); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
321 break; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
322 case TRUST.TRUSTsafe: |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
323 buf.writestring("Nd"); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
324 break; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
325 } |
0 | 326 } |
327 // Write argument types | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
328 Parameter.argsToDecoBuffer(buf, parameters); |
0 | 329 //if (buf.data[buf.offset - 1] == '@') halt(); |
330 buf.writeByte('Z' - varargs); // mark end of arg list | |
79 | 331 assert(next); |
0 | 332 next.toDecoBuffer(buf); |
333 inuse--; | |
334 } | |
335 | |
72 | 336 override void toCBuffer(OutBuffer buf, Identifier ident, HdrGenState* hgs) |
0 | 337 { |
338 //printf("TypeFunction.toCBuffer() this = %p\n", this); | |
339 string p = null; | |
340 | |
341 if (inuse) | |
342 { | |
343 inuse = 2; // flag error to caller | |
344 return; | |
345 } | |
346 inuse++; | |
347 | |
348 /* Use 'storage class' style for attributes | |
349 */ | |
350 if (mod & MODconst) | |
351 buf.writestring("const "); | |
352 if (mod & MODinvariant) | |
353 buf.writestring("immutable "); | |
354 if (mod & MODshared) | |
355 buf.writestring("shared "); | |
356 | |
357 if (ispure) | |
358 buf.writestring("pure "); | |
359 if (isnothrow) | |
360 buf.writestring("nothrow "); | |
361 if (isproperty) | |
362 buf.writestring("@property "); | |
363 if (isref) | |
364 buf.writestring("ref "); | |
365 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
366 switch (trust) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
367 { |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
368 case TRUST.TRUSTtrusted: |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
369 buf.writestring("@trusted "); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
370 break; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
371 |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
372 case TRUST.TRUSTsafe: |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
373 buf.writestring("@safe "); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
374 break; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
375 } |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
376 |
0 | 377 if (next && (!ident || ident.toHChars2() == ident.toChars())) |
378 next.toCBuffer2(buf, hgs, MODundefined); | |
379 if (hgs.ddoc != 1) | |
380 { | |
381 switch (linkage) | |
382 { | |
383 case LINKd: p = null; break; | |
73 | 384 case LINKc: p = " C"; break; |
385 case LINKwindows: p = " Windows"; break; | |
386 case LINKpascal: p = " Pascal"; break; | |
387 case LINKcpp: p = " C++"; break; | |
0 | 388 default: |
389 assert(0); | |
390 } | |
391 } | |
392 | |
393 if (!hgs.hdrgen && p) | |
394 buf.writestring(p); | |
395 if (ident) | |
396 { | |
397 buf.writeByte(' '); | |
398 buf.writestring(ident.toHChars2()); | |
399 } | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
400 Parameter.argsToCBuffer(buf, hgs, parameters, varargs); |
0 | 401 inuse--; |
402 } | |
403 | |
72 | 404 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) |
0 | 405 { |
406 //printf("TypeFunction::toCBuffer2() this = %p, ref = %d\n", this, isref); | |
407 string p; | |
408 | |
409 if (inuse) | |
410 { | |
411 inuse = 2; // flag error to caller | |
412 return; | |
413 } | |
414 | |
415 inuse++; | |
416 if (next) | |
417 next.toCBuffer2(buf, hgs, MODundefined); | |
418 | |
419 if (hgs.ddoc != 1) | |
420 { | |
421 switch (linkage) | |
422 { | |
423 case LINKd: p = null; break; | |
424 case LINKc: p = "C "; break; | |
425 case LINKwindows: p = "Windows "; break; | |
426 case LINKpascal: p = "Pascal "; break; | |
427 case LINKcpp: p = "C++ "; break; | |
428 default: assert(0); | |
429 } | |
430 } | |
431 | |
432 if (!hgs.hdrgen && p) | |
433 buf.writestring(p); | |
434 buf.writestring(" function"); | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
435 Parameter.argsToCBuffer(buf, hgs, parameters, varargs); |
0 | 436 |
437 /* Use postfix style for attributes | |
438 */ | |
439 if (mod != this.mod) | |
440 { | |
441 modToBuffer(buf); | |
442 } | |
443 | |
444 if (ispure) | |
445 buf.writestring(" pure"); | |
446 if (isnothrow) | |
447 buf.writestring(" nothrow"); | |
448 if (isproperty) | |
449 buf.writestring(" @property"); | |
450 if (isref) | |
451 buf.writestring(" ref"); | |
452 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
453 switch (trust) |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
454 { |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
455 case TRUSTtrusted: |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
456 buf.writestring(" @trusted"); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
457 break; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
458 |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
459 case TRUSTsafe: |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
460 buf.writestring(" @safe"); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
461 break; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
462 } |
0 | 463 inuse--; |
464 } | |
465 | |
72 | 466 override MATCH deduceType(Scope sc, Type tparam, TemplateParameters parameters, Objects dedtypes) |
0 | 467 { |
123 | 468 //printf("TypeFunction.deduceType()\n"); |
469 //printf("\tthis = %d, ", ty); print(); | |
470 //printf("\ttparam = %d, ", tparam.ty); tparam.print(); | |
471 | |
472 // Extra check that function characteristics must match | |
473 if (tparam && tparam.ty == Tfunction) | |
474 { | |
475 TypeFunction tp = cast(TypeFunction)tparam; | |
476 if (varargs != tp.varargs || | |
477 linkage != tp.linkage) | |
478 return MATCHnomatch; | |
479 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
480 size_t nfargs = Parameter.dim(this.parameters); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
481 size_t nfparams = Parameter.dim(tp.parameters); |
123 | 482 |
483 /* See if tuple match | |
484 */ | |
485 if (nfparams > 0 && nfargs >= nfparams - 1) | |
486 { | |
487 /* See if 'A' of the template parameter matches 'A' | |
488 * of the type of the last function parameter. | |
489 */ | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
490 auto fparam = Parameter.getNth(tp.parameters, nfparams - 1); |
123 | 491 assert(fparam); |
492 assert(fparam.type); | |
493 if (fparam.type.ty != Tident) | |
494 goto L1; | |
495 TypeIdentifier tid = cast(TypeIdentifier)fparam.type; | |
496 if (tid.idents.dim) | |
497 goto L1; | |
498 | |
499 /* Look through parameters to find tuple matching tid.ident | |
500 */ | |
501 size_t tupi = 0; | |
502 for (; 1; tupi++) | |
503 { | |
504 if (tupi == parameters.dim) | |
505 goto L1; | |
506 TemplateParameter t = parameters[tupi]; | |
507 TemplateTupleParameter tup = t.isTemplateTupleParameter(); | |
508 if (tup && tup.ident.equals(tid.ident)) | |
509 break; | |
510 } | |
511 | |
512 /* The types of the function arguments [nfparams - 1 .. nfargs] | |
513 * now form the tuple argument. | |
514 */ | |
515 int tuple_dim = nfargs - (nfparams - 1); | |
516 | |
517 /* See if existing tuple, and whether it matches or not | |
518 */ | |
519 Object o = dedtypes[tupi]; | |
520 if (o) | |
521 { | |
522 // Existing deduced argument must be a tuple, and must match | |
523 Tuple t = isTuple(o); | |
524 if (!t || t.objects.dim != tuple_dim) | |
525 return MATCHnomatch; | |
526 for (size_t i = 0; i < tuple_dim; i++) | |
527 { | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
528 auto arg = Parameter.getNth(this.parameters, nfparams - 1 + i); |
123 | 529 if (!arg.type.equals(t.objects[i])) |
530 return MATCHnomatch; | |
531 } | |
532 } | |
533 else | |
534 { // Create new tuple | |
535 Tuple t = new Tuple(); | |
536 t.objects.setDim(tuple_dim); | |
537 for (size_t i = 0; i < tuple_dim; i++) | |
538 { | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
539 auto arg = Parameter.getNth(this.parameters, nfparams - 1 + i); |
123 | 540 t.objects[i] = arg.type; |
541 } | |
542 dedtypes[tupi] = t; | |
543 } | |
544 nfparams--; // don't consider the last parameter for type deduction | |
545 goto L2; | |
546 } | |
547 | |
548 L1: | |
549 if (nfargs != nfparams) | |
550 return MATCHnomatch; | |
551 L2: | |
552 for (size_t i = 0; i < nfparams; i++) | |
553 { | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
554 auto a = Parameter.getNth(this.parameters, i); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
555 auto ap = Parameter.getNth(tp.parameters, i); |
123 | 556 if (a.storageClass != ap.storageClass || |
557 !a.type.deduceType(sc, ap.type, parameters, dedtypes)) | |
558 return MATCHnomatch; | |
559 } | |
560 } | |
561 return Type.deduceType(sc, tparam, parameters, dedtypes); | |
0 | 562 } |
563 | |
72 | 564 override TypeInfoDeclaration getTypeInfoDeclaration() |
0 | 565 { |
129 | 566 return new TypeInfoFunctionDeclaration(this); |
0 | 567 } |
568 | |
72 | 569 override Type reliesOnTident() |
0 | 570 { |
571 if (parameters) | |
572 { | |
126
1765f3ef917d
ClassDeclarations, Arguments -> Vector
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
123
diff
changeset
|
573 foreach (arg; parameters) |
0 | 574 { |
575 Type t = arg.type.reliesOnTident(); | |
576 if (t) | |
577 return t; | |
578 } | |
579 } | |
580 return next.reliesOnTident(); | |
581 } | |
582 | |
583 version (CPP_MANGLE) { | |
584 void toCppMangle(OutBuffer buf, CppMangleState* cms) | |
585 { | |
586 assert(false); | |
587 } | |
588 } | |
589 | |
590 /*************************** | |
591 * Examine function signature for parameter p and see if | |
592 * p can 'escape' the scope of the function. | |
593 */ | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
594 bool parameterEscapes(Parameter p) |
0 | 595 { |
596 /* Scope parameters do not escape. | |
597 * Allow 'lazy' to imply 'scope' - | |
598 * lazy parameters can be passed along | |
599 * as lazy parameters to the next function, but that isn't | |
600 * escaping. | |
601 */ | |
602 if (p.storageClass & (STC.STCscope | STC.STClazy)) | |
603 return false; | |
604 | |
605 if (ispure) | |
606 { /* With pure functions, we need only be concerned if p escapes | |
607 * via any return statement. | |
608 */ | |
609 Type tret = nextOf().toBasetype(); | |
610 if (!isref && !tret.hasPointers()) | |
611 { /* The result has no references, so p could not be escaping | |
612 * that way. | |
613 */ | |
614 return false; | |
615 } | |
616 } | |
617 | |
618 /* Assume it escapes in the absence of better information. | |
619 */ | |
620 return true; | |
621 } | |
622 | |
623 /******************************** | |
624 * 'args' are being matched to function 'this' | |
625 * Determine match level. | |
626 * Returns: | |
627 * MATCHxxxx | |
628 */ | |
629 MATCH callMatch(Expression ethis, Expressions args) | |
630 { | |
631 //printf("TypeFunction.callMatch() %s\n", toChars()); | |
632 MATCH match = MATCH.MATCHexact; // assume exact match | |
633 | |
634 if (ethis) | |
635 { | |
636 Type t = ethis.type; | |
637 if (t.toBasetype().ty == TY.Tpointer) | |
638 t = t.toBasetype().nextOf(); // change struct* to struct | |
639 | |
640 if (t.mod != mod) | |
641 { | |
642 if (mod == MOD.MODconst) | |
643 match = MATCH.MATCHconst; | |
644 else | |
645 return MATCH.MATCHnomatch; | |
646 } | |
647 } | |
648 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
649 size_t nparams = Parameter.dim(parameters); |
0 | 650 size_t nargs = args ? args.dim : 0; |
651 if (nparams == nargs) { | |
652 ; | |
653 } else if (nargs > nparams) | |
654 { | |
655 if (varargs == 0) | |
656 goto Nomatch; // too many args; no match | |
657 match = MATCH.MATCHconvert; // match ... with a "conversion" match level | |
658 } | |
659 | |
660 for (size_t u = 0; u < nparams; u++) | |
661 { | |
662 MATCH m; | |
663 Expression arg; | |
664 | |
665 // BUG: what about out and ref? | |
666 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
667 auto p = Parameter.getNth(parameters, u); |
0 | 668 assert(p); |
669 if (u >= nargs) | |
670 { | |
671 if (p.defaultArg) | |
672 continue; | |
673 if (varargs == 2 && u + 1 == nparams) | |
674 goto L1; | |
675 goto Nomatch; // not enough arguments | |
676 } | |
677 | |
113
3482c73a991b
More cleanup for arrays
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
96
diff
changeset
|
678 arg = cast(Expression)args[u]; |
0 | 679 assert(arg); |
96 | 680 // writef("arg: %s, type: %s\n", arg.toChars(), arg.type.toChars()); |
681 | |
0 | 682 |
683 // Non-lvalues do not match ref or out parameters | |
96 | 684 if (p.storageClass & (STC.STCref | STC.STCout)) |
685 { | |
686 if (!arg.isLvalue()) | |
687 goto Nomatch; | |
688 } | |
689 | |
690 if (p.storageClass & STCref) | |
691 { | |
692 /* Don't allow static arrays to be passed to mutable refereces | |
693 * to static arrays if the argument cannot be modified. | |
694 */ | |
695 Type targb = arg.type.toBasetype(); | |
696 Type tparb = p.type.toBasetype(); | |
697 //writef("%s\n", targb.toChars()); | |
698 //writef("%s\n", tparb.toChars()); | |
699 if (targb.nextOf() && tparb.ty == Tsarray && | |
700 targb.nextOf().mod != tparb.nextOf().mod && | |
701 !tparb.nextOf().isConst()) | |
702 goto Nomatch; | |
703 } | |
0 | 704 |
705 if (p.storageClass & STC.STClazy && p.type.ty == TY.Tvoid && arg.type.ty != TY.Tvoid) | |
706 m = MATCH.MATCHconvert; | |
707 else | |
708 m = arg.implicitConvTo(p.type); | |
709 //printf("\tm = %d\n", m); | |
710 if (m == MATCH.MATCHnomatch) // if no match | |
711 { | |
712 L1: | |
713 if (varargs == 2 && u + 1 == nparams) // if last varargs param | |
714 { | |
715 Type tb = p.type.toBasetype(); | |
716 TypeSArray tsa; | |
717 long sz; | |
718 | |
719 switch (tb.ty) | |
720 { | |
721 case TY.Tsarray: | |
722 tsa = cast(TypeSArray)tb; | |
723 sz = tsa.dim.toInteger(); | |
724 if (sz != nargs - u) | |
725 goto Nomatch; | |
726 case TY.Tarray: | |
727 { | |
728 TypeArray ta = cast(TypeArray)tb; | |
729 for (; u < nargs; u++) | |
730 { | |
113
3482c73a991b
More cleanup for arrays
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
96
diff
changeset
|
731 arg = cast(Expression)args[u]; |
0 | 732 assert(arg); |
733 static if (true) { | |
734 /* If lazy array of delegates, | |
735 * convert arg(s) to delegate(s) | |
736 */ | |
737 Type tret = p.isLazyArray(); | |
738 if (tret) | |
739 { | |
740 if (ta.next.equals(arg.type)) | |
741 { | |
742 m = MATCH.MATCHexact; | |
743 } | |
744 else | |
745 { | |
746 m = arg.implicitConvTo(tret); | |
747 if (m == MATCH.MATCHnomatch) | |
748 { | |
749 if (tret.toBasetype().ty == TY.Tvoid) | |
750 m = MATCH.MATCHconvert; | |
751 } | |
752 } | |
753 } | |
754 else | |
755 m = arg.implicitConvTo(ta.next); | |
756 } else { | |
757 m = arg.implicitConvTo(ta.next); | |
758 } | |
759 if (m == MATCH.MATCHnomatch) | |
760 goto Nomatch; | |
761 | |
762 if (m < match) | |
763 match = m; | |
764 } | |
765 goto Ldone; | |
766 } | |
767 | |
768 case TY.Tclass: | |
769 // Should see if there's a constructor match? | |
770 // Or just leave it ambiguous? | |
771 goto Ldone; | |
772 | |
773 default: | |
774 goto Nomatch; | |
775 } | |
776 } | |
777 | |
778 goto Nomatch; | |
779 } | |
780 | |
781 if (m < match) | |
782 match = m; // pick worst match | |
783 } | |
784 | |
785 Ldone: | |
786 //printf("match = %d\n", match); | |
787 return match; | |
788 | |
789 Nomatch: | |
790 //printf("no match\n"); | |
791 return MATCH.MATCHnomatch; | |
792 } | |
793 | |
96 | 794 override type* toCtype() |
0 | 795 { |
796 if (ctype) { | |
797 return ctype; | |
798 } | |
799 | |
800 type* t; | |
801 if (true) | |
802 { | |
803 param_t* paramtypes; | |
804 tym_t tyf; | |
805 type* tp; | |
806 | |
807 paramtypes = null; | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
808 size_t nparams = Parameter.dim(parameters); |
0 | 809 for (size_t i = 0; i < nparams; i++) |
810 { | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
129
diff
changeset
|
811 auto arg = Parameter.getNth(parameters, i); |
0 | 812 tp = arg.type.toCtype(); |
813 if (arg.storageClass & (STC.STCout | STC.STCref)) | |
814 { | |
815 // C doesn't have reference types, so it's really a pointer | |
816 // to the parameter type | |
817 tp = type_allocn(TYM.TYref, tp); | |
818 } | |
819 param_append_type(¶mtypes,tp); | |
820 } | |
821 tyf = totym(); | |
822 t = type_alloc(tyf); | |
823 t.Tflags |= TF.TFprototype; | |
824 if (varargs != 1) | |
825 t.Tflags |= TF.TFfixed; | |
826 ctype = t; | |
827 t.Tnext = next.toCtype(); | |
828 t.Tnext.Tcount++; | |
829 t.Tparamtypes = paramtypes; | |
830 } | |
831 ctype = t; | |
832 return t; | |
833 } | |
834 | |
835 /*************************** | |
836 * Determine return style of function - whether in registers or | |
837 * through a hidden pointer to the caller's stack. | |
838 */ | |
96 | 839 RET retStyle() |
0 | 840 { |
841 //printf("TypeFunction.retStyle() %s\n", toChars()); | |
95 | 842 version (DMDV2) |
843 { | |
0 | 844 if (isref) |
845 return RET.RETregs; // returns a pointer | |
846 } | |
847 | |
848 Type tn = next.toBasetype(); | |
95 | 849 Type tns = tn; |
850 ulong sz = tn.size(); | |
0 | 851 |
95 | 852 version(SARRAYVALUE) |
853 { | |
854 if (tn.ty == Tsarray) | |
855 { | |
856 do | |
857 { | |
858 tns = tns.nextOf().toBasetype(); | |
859 } while (tns.ty == Tsarray); | |
860 if (tns.ty != Tstruct) | |
861 { | |
862 if (global.params.isLinux && linkage != LINKd) | |
863 {} | |
864 else | |
865 { | |
866 switch (sz) | |
867 { case 1: | |
868 case 2: | |
869 case 4: | |
870 case 8: | |
96 | 871 return RET.RETregs; // return small structs in regs |
872 // (not 3 byte structs!) | |
95 | 873 default: |
874 break; | |
875 } | |
876 } | |
96 | 877 return RET.RETstack; |
95 | 878 } |
879 } | |
880 } | |
881 if (tns.ty == TY.Tstruct) | |
0 | 882 { |
883 StructDeclaration sd = (cast(TypeStruct)tn).sym; | |
884 if (global.params.isLinux && linkage != LINK.LINKd) { | |
885 ; | |
886 } | |
95 | 887 ///version (DMDV2) { // TODO: |
888 else if (sd.dtor || sd.cpctor) | |
889 { | |
0 | 890 } |
891 ///} | |
892 else | |
893 { | |
95 | 894 switch (sz) |
0 | 895 { |
896 case 1: | |
897 case 2: | |
898 case 4: | |
899 case 8: | |
900 return RET.RETregs; // return small structs in regs | |
901 // (not 3 byte structs!) | |
902 default: | |
903 break; | |
904 } | |
905 } | |
906 return RET.RETstack; | |
907 } | |
908 else if ((global.params.isLinux || global.params.isOSX || global.params.isFreeBSD || global.params.isSolaris) && | |
909 linkage == LINK.LINKc && | |
910 tn.iscomplex()) | |
911 { | |
912 if (tn.ty == TY.Tcomplex32) | |
913 return RET.RETregs; // in EDX:EAX, not ST1:ST0 | |
914 else | |
915 return RET.RETstack; | |
916 } | |
917 else | |
918 return RET.RETregs; | |
919 } | |
920 | |
72 | 921 override TYM totym() |
0 | 922 { |
923 TYM tyf; | |
924 | |
925 //printf("TypeFunction.totym(), linkage = %d\n", linkage); | |
926 switch (linkage) | |
927 { | |
928 case LINK.LINKwindows: | |
929 tyf = (varargs == 1) ? TYM.TYnfunc : TYM.TYnsfunc; | |
930 break; | |
931 | |
932 case LINK.LINKpascal: | |
933 tyf = (varargs == 1) ? TYM.TYnfunc : TYM.TYnpfunc; | |
934 break; | |
935 | |
936 case LINK.LINKc: | |
937 tyf = TYM.TYnfunc; | |
22
fd4acc376c45
Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
938 version (POSIX) {///TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS |
0 | 939 if (retStyle() == RET.RETstack) |
940 tyf = TYM.TYhfunc; | |
941 } | |
942 break; | |
943 | |
944 case LINK.LINKd: | |
945 tyf = (varargs == 1) ? TYM.TYnfunc : TYM.TYjfunc; | |
946 break; | |
947 | |
948 case LINK.LINKcpp: | |
949 tyf = TYM.TYnfunc; | |
950 break; | |
951 | |
952 default: | |
953 writef("linkage = %d\n", linkage); | |
954 assert(0); | |
955 } | |
956 version (DMDV2) { | |
957 if (isnothrow) | |
958 tyf |= mTY.mTYnothrow; | |
959 } | |
960 return tyf; | |
961 } | |
22
fd4acc376c45
Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
962 } |