2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2007 by Digital Mars
5 // written by Walter Bright
6 // http://www.digitalmars.com
7 // License for redistribution is by either the Artistic License
8 // in artistic.txt, or the GNU General Public License in gnu.txt.
9 // See the included readme.txt for details.
11 /* NOTE: This file has been patched from the original DMD distribution to
12 work with the GDC compiler.
14 Modified by David Friedman, January 2007
27 #include "stringtable.h"
29 #include "arraytypes.h"
30 #include "expression.h"
35 struct StructDeclaration
;
36 struct ClassDeclaration
;
37 struct VarDeclaration
;
38 struct EnumDeclaration
;
39 struct TypedefDeclaration
;
40 struct TypeInfoDeclaration
;
42 struct TemplateInstance
;
43 struct CppMangleState
;
51 union tree_node
; typedef union tree_node TYPE
;
54 typedef struct TYPE type
;
62 Tarray
, // dynamic array
63 Tsarray
, // static array
64 Taarray
, // associative array
111 typedef unsigned char TY
; // ENUMTY
118 extern int Tptrdiff_t
;
125 unsigned char mod
; // modifiers (MODconst, MODinvariant)
126 #define MODconst 1 // type is const
127 #define MODinvariant 2 // type is invariant
129 Type
*cto
; // MODconst ? mutable version of this type : const version
130 Type
*ito
; // MODinvariant ? mutable version of this type : invariant version
131 Type
*pto
; // merged pointer to this type
132 Type
*rto
; // reference to this type
133 Type
*arrayof
; // array of this type
134 TypeInfoDeclaration
*vtinfo
; // TypeInfo object for this Type
136 type
*ctype
; // for back end
138 #define tvoid basic[Tvoid]
139 #define tint8 basic[Tint8]
140 #define tuns8 basic[Tuns8]
141 #define tint16 basic[Tint16]
142 #define tuns16 basic[Tuns16]
143 #define tint32 basic[Tint32]
144 #define tuns32 basic[Tuns32]
145 #define tint64 basic[Tint64]
146 #define tuns64 basic[Tuns64]
147 #define tfloat32 basic[Tfloat32]
148 #define tfloat64 basic[Tfloat64]
149 #define tfloat80 basic[Tfloat80]
151 #define timaginary32 basic[Timaginary32]
152 #define timaginary64 basic[Timaginary64]
153 #define timaginary80 basic[Timaginary80]
155 #define tcomplex32 basic[Tcomplex32]
156 #define tcomplex64 basic[Tcomplex64]
157 #define tcomplex80 basic[Tcomplex80]
159 #define tbit basic[Tbit]
160 #define tbool basic[Tbool]
161 #define tchar basic[Tchar]
162 #define twchar basic[Twchar]
163 #define tdchar basic[Tdchar]
165 // Some special types
166 #define tshiftcnt tint32 // right side of shift expression
167 // #define tboolean tint32 // result of boolean expression
168 #define tboolean tbool // result of boolean expression
169 #define tindex basic[Tindex] // array/ptr index
170 static Type
*tvoidptr
; // void*
171 #define terror basic[Terror] // for error recovery
173 #define tsize_t basic[Tsize_t] // matches size_t alias
174 #define tptrdiff_t basic[Tptrdiff_t] // matches ptrdiff_t alias
175 #define thash_t tsize_t // matches hash_t alias
177 static ClassDeclaration
*typeinfo
;
178 static ClassDeclaration
*typeinfoclass
;
179 static ClassDeclaration
*typeinfointerface
;
180 static ClassDeclaration
*typeinfostruct
;
181 static ClassDeclaration
*typeinfotypedef
;
182 static ClassDeclaration
*typeinfopointer
;
183 static ClassDeclaration
*typeinfoarray
;
184 static ClassDeclaration
*typeinfostaticarray
;
185 static ClassDeclaration
*typeinfoassociativearray
;
186 static ClassDeclaration
*typeinfoenum
;
187 static ClassDeclaration
*typeinfofunction
;
188 static ClassDeclaration
*typeinfodelegate
;
189 static ClassDeclaration
*typeinfotypelist
;
190 static ClassDeclaration
*typeinfoconst
;
191 static ClassDeclaration
*typeinfoinvariant
;
193 static Type
*basic
[TMAX
];
194 static unsigned char mangleChar
[TMAX
];
195 static unsigned char sizeTy
[TMAX
];
196 static StringTable stringtable
;
198 // These tables are for implicit conversion of binary ops;
199 // the indices are the type of operand one, followed by operand two.
200 static unsigned char impcnvResult
[TMAX
][TMAX
];
201 static unsigned char impcnvType1
[TMAX
][TMAX
];
202 static unsigned char impcnvType2
[TMAX
][TMAX
];
204 // If !=0, give warning on implicit conversion
205 static unsigned char impcnvWarn
[TMAX
][TMAX
];
208 virtual Type
*syntaxCopy();
209 int equals(Object
*o
);
210 int dyncast() { return DYNCAST_TYPE
; } // kludge for template.isType()
211 int covariant(Type
*t
);
213 static char needThisPrefix();
216 virtual d_uns64
size(Loc loc
);
217 virtual unsigned alignsize();
218 virtual Type
*semantic(Loc loc
, Scope
*sc
);
219 virtual void toDecoBuffer(OutBuffer
*buf
, int flag
= 0);
221 virtual void toCBuffer(OutBuffer
*buf
, Identifier
*ident
, HdrGenState
*hgs
);
222 virtual void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
223 void toCBuffer3(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
224 #if IN_GCC || TARGET_LINUX
225 virtual void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
227 virtual int isintegral();
228 virtual int isfloating(); // real, imaginary, or complex
229 virtual int isreal();
230 virtual int isimaginary();
231 virtual int iscomplex();
232 virtual int isscalar();
233 virtual int isunsigned();
234 virtual int isauto();
235 virtual int isString();
236 virtual int isAssignable();
237 virtual int checkBoolean(); // if can be converted to boolean value
238 virtual void checkDeprecated(Loc loc
, Scope
*sc
);
239 int isConst() { return mod
== MODconst
; }
240 int isInvariant() { return mod
== MODinvariant
; }
241 int isMutable() { return mod
== 0; }
248 virtual Type
*makeConst();
249 virtual Type
*makeInvariant();
250 virtual Dsymbol
*toDsymbol(Scope
*sc
);
251 virtual Type
*toBasetype();
252 virtual Type
*toHeadMutable();
253 virtual int isBaseOf(Type
*t
, target_ptrdiff_t
*poffset
);
254 virtual MATCH
constConv(Type
*to
);
255 virtual MATCH
implicitConvTo(Type
*to
);
256 virtual ClassDeclaration
*isClassHandle();
257 virtual Expression
*getProperty(Loc loc
, Identifier
*ident
);
258 virtual Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
259 virtual unsigned memalign(unsigned salign
);
260 virtual Expression
*defaultInit(Loc loc
= 0);
261 virtual int isZeroInit(); // if initializer is 0
262 virtual dt_t
**toDt(dt_t
**pdt
);
263 Identifier
*getTypeInfoIdent(int internal
);
264 virtual MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
265 virtual void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
266 Expression
*getInternalTypeInfo(Scope
*sc
);
267 Expression
*getTypeInfo(Scope
*sc
);
268 virtual TypeInfoDeclaration
*getTypeInfoDeclaration();
269 virtual int builtinTypeInfo();
270 virtual Type
*reliesOnTident();
271 virtual Expression
*toExpression();
272 virtual int hasPointers();
273 virtual Type
*nextOf();
275 static void error(Loc loc
, const char *format
, ...);
278 virtual unsigned totym();
279 virtual type
*toCtype();
280 virtual type
*toCParamtype();
281 virtual Symbol
*toSymbol();
283 // For eliminating dynamic_cast
284 virtual TypeBasic
*isTypeBasic();
287 struct TypeNext
: Type
291 TypeNext(TY ty
, Type
*next
);
292 void toDecoBuffer(OutBuffer
*buf
, int flag
);
293 void checkDeprecated(Loc loc
, Scope
*sc
);
294 Type
*reliesOnTident();
297 Type
*makeInvariant();
298 MATCH
constConv(Type
*to
);
301 struct TypeBasic
: Type
308 d_uns64
size(Loc loc
);
309 unsigned alignsize();
310 Expression
*getProperty(Loc loc
, Identifier
*ident
);
311 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
313 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
314 #if IN_GCC || TARGET_LINUX
315 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
325 MATCH
implicitConvTo(Type
*to
);
326 Expression
*defaultInit(Loc loc
);
328 int builtinTypeInfo();
330 // For eliminating dynamic_cast
331 TypeBasic
*isTypeBasic();
334 struct TypeArray
: TypeNext
336 TypeArray(TY ty
, Type
*next
);
337 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
340 // Static array, one with a fixed dimension
341 struct TypeSArray
: TypeArray
345 TypeSArray(Type
*t
, Expression
*dim
);
347 d_uns64
size(Loc loc
);
348 unsigned alignsize();
349 Type
*semantic(Loc loc
, Scope
*sc
);
350 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
351 void toDecoBuffer(OutBuffer
*buf
, int flag
);
352 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
353 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
356 unsigned memalign(unsigned salign
);
357 MATCH
constConv(Type
*to
);
358 MATCH
implicitConvTo(Type
*to
);
359 Expression
*defaultInit(Loc loc
);
360 dt_t
**toDt(dt_t
**pdt
);
361 dt_t
**toDtElem(dt_t
**pdt
, Expression
*e
);
362 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
363 TypeInfoDeclaration
*getTypeInfoDeclaration();
364 Expression
*toExpression();
366 #if IN_GCC || TARGET_LINUX
367 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
371 type
*toCParamtype();
374 // Dynamic array, no dimension
375 struct TypeDArray
: TypeArray
379 d_uns64
size(Loc loc
);
380 unsigned alignsize();
381 Type
*semantic(Loc loc
, Scope
*sc
);
382 void toDecoBuffer(OutBuffer
*buf
, int flag
);
383 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
384 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
388 MATCH
implicitConvTo(Type
*to
);
389 Expression
*defaultInit(Loc loc
);
390 int builtinTypeInfo();
391 TypeInfoDeclaration
*getTypeInfoDeclaration();
393 #if IN_GCC || TARGET_LINUX
394 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
400 struct TypeAArray
: TypeArray
402 Type
*index
; // key type
404 TypeAArray(Type
*t
, Type
*index
);
406 d_uns64
size(Loc loc
);
407 Type
*semantic(Loc loc
, Scope
*sc
);
408 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
409 void toDecoBuffer(OutBuffer
*buf
, int flag
);
410 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
411 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
412 Expression
*defaultInit(Loc loc
);
413 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
415 TypeInfoDeclaration
*getTypeInfoDeclaration();
417 MATCH
implicitConvTo(Type
*to
);
418 MATCH
constConv(Type
*to
);
419 #if IN_GCC || TARGET_LINUX
420 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
424 Symbol
*aaGetSymbol(char *func
, int flags
);
429 struct TypePointer
: TypeNext
431 TypePointer(Type
*t
);
433 Type
*semantic(Loc loc
, Scope
*sc
);
434 d_uns64
size(Loc loc
);
435 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
436 MATCH
implicitConvTo(Type
*to
);
438 Expression
*defaultInit(Loc loc
);
440 TypeInfoDeclaration
*getTypeInfoDeclaration();
442 #if IN_GCC || TARGET_LINUX
443 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
449 struct TypeReference
: TypeNext
451 TypeReference(Type
*t
);
453 Type
*semantic(Loc loc
, Scope
*sc
);
454 d_uns64
size(Loc loc
);
455 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
456 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
457 Expression
*defaultInit(Loc loc
);
459 #if IN_GCC || TARGET_LINUX
460 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
466 RETregs
= 1, // returned in registers
467 RETstack
= 2, // returned on stack
470 struct TypeFunction
: TypeNext
472 // .next is the return type
474 Arguments
*parameters
; // function parameters
475 int varargs
; // 1: T t, ...) style for variable number of arguments
476 // 2: T t ...) style for variable number of arguments
477 bool isnothrow
; // true: nothrow
478 bool ispure
; // true: pure
479 enum LINK linkage
; // calling convention
483 TypeFunction(Arguments
*parameters
, Type
*treturn
, int varargs
, enum LINK linkage
);
485 Type
*semantic(Loc loc
, Scope
*sc
);
486 void toDecoBuffer(OutBuffer
*buf
, int flag
);
487 void toCBuffer(OutBuffer
*buf
, Identifier
*ident
, HdrGenState
*hgs
);
488 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
489 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
490 TypeInfoDeclaration
*getTypeInfoDeclaration();
491 Type
*reliesOnTident();
492 #if IN_GCC || TARGET_LINUX
493 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
496 int callMatch(Expression
*ethis
, Expressions
*toargs
);
503 struct TypeDelegate
: TypeNext
505 // .next is a TypeFunction
507 TypeDelegate(Type
*t
);
509 Type
*semantic(Loc loc
, Scope
*sc
);
510 d_uns64
size(Loc loc
);
511 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
512 Expression
*defaultInit(Loc loc
);
515 TypeInfoDeclaration
*getTypeInfoDeclaration();
516 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
518 #if IN_GCC || TARGET_LINUX
519 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
525 struct TypeQualified
: Type
528 Array idents
; // array of Identifier's representing ident.ident.ident etc.
530 TypeQualified(TY ty
, Loc loc
);
531 void syntaxCopyHelper(TypeQualified
*t
);
532 void addIdent(Identifier
*ident
);
533 void toCBuffer2Helper(OutBuffer
*buf
, HdrGenState
*hgs
);
534 d_uns64
size(Loc loc
);
535 void resolveHelper(Loc loc
, Scope
*sc
, Dsymbol
*s
, Dsymbol
*scopesym
,
536 Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
539 struct TypeIdentifier
: TypeQualified
543 TypeIdentifier(Loc loc
, Identifier
*ident
);
546 void toDecoBuffer(OutBuffer
*buf
, int flag
);
547 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
548 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
549 Dsymbol
*toDsymbol(Scope
*sc
);
550 Type
*semantic(Loc loc
, Scope
*sc
);
551 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
552 Type
*reliesOnTident();
553 Expression
*toExpression();
556 /* Similar to TypeIdentifier, but with a TemplateInstance as the root
558 struct TypeInstance
: TypeQualified
560 TemplateInstance
*tempinst
;
562 TypeInstance(Loc loc
, TemplateInstance
*tempinst
);
565 //void toDecoBuffer(OutBuffer *buf, int flag);
566 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
567 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
568 Type
*semantic(Loc loc
, Scope
*sc
);
569 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
572 struct TypeTypeof
: TypeQualified
576 TypeTypeof(Loc loc
, Expression
*exp
);
578 Dsymbol
*toDsymbol(Scope
*sc
);
579 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
580 Type
*semantic(Loc loc
, Scope
*sc
);
581 d_uns64
size(Loc loc
);
584 struct TypeReturn
: TypeQualified
588 Dsymbol
*toDsymbol(Scope
*sc
);
589 Type
*semantic(Loc loc
, Scope
*sc
);
590 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
593 struct TypeStruct
: Type
595 StructDeclaration
*sym
;
597 TypeStruct(StructDeclaration
*sym
);
598 d_uns64
size(Loc loc
);
599 unsigned alignsize();
602 Type
*semantic(Loc loc
, Scope
*sc
);
603 Dsymbol
*toDsymbol(Scope
*sc
);
604 void toDecoBuffer(OutBuffer
*buf
, int flag
);
605 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
606 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
607 unsigned memalign(unsigned salign
);
608 Expression
*defaultInit(Loc loc
);
612 dt_t
**toDt(dt_t
**pdt
);
613 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
614 TypeInfoDeclaration
*getTypeInfoDeclaration();
616 MATCH
implicitConvTo(Type
*to
);
617 MATCH
constConv(Type
*to
);
618 Type
*toHeadMutable();
619 #if IN_GCC || TARGET_LINUX
620 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
626 struct TypeEnum
: Type
628 EnumDeclaration
*sym
;
630 TypeEnum(EnumDeclaration
*sym
);
631 d_uns64
size(Loc loc
);
632 unsigned alignsize();
634 Type
*semantic(Loc loc
, Scope
*sc
);
635 Dsymbol
*toDsymbol(Scope
*sc
);
636 void toDecoBuffer(OutBuffer
*buf
, int flag
);
637 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
638 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
639 Expression
*getProperty(Loc loc
, Identifier
*ident
);
644 MATCH
implicitConvTo(Type
*to
);
645 MATCH
constConv(Type
*to
);
647 Expression
*defaultInit(Loc loc
);
649 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
650 TypeInfoDeclaration
*getTypeInfoDeclaration();
652 #if IN_GCC || TARGET_LINUX
653 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
659 struct TypeTypedef
: Type
661 TypedefDeclaration
*sym
;
663 TypeTypedef(TypedefDeclaration
*sym
);
665 d_uns64
size(Loc loc
);
666 unsigned alignsize();
668 Type
*semantic(Loc loc
, Scope
*sc
);
669 Dsymbol
*toDsymbol(Scope
*sc
);
670 void toDecoBuffer(OutBuffer
*buf
, int flag
);
671 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
672 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
673 Expression
*getProperty(Loc loc
, Identifier
*ident
);
685 MATCH
implicitConvTo(Type
*to
);
686 MATCH
constConv(Type
*to
);
687 Expression
*defaultInit(Loc loc
);
689 dt_t
**toDt(dt_t
**pdt
);
690 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
691 TypeInfoDeclaration
*getTypeInfoDeclaration();
693 Type
*toHeadMutable();
694 #if IN_GCC || TARGET_LINUX
695 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
699 type
*toCParamtype();
702 struct TypeClass
: Type
704 ClassDeclaration
*sym
;
706 TypeClass(ClassDeclaration
*sym
);
707 d_uns64
size(Loc loc
);
710 Type
*semantic(Loc loc
, Scope
*sc
);
711 Dsymbol
*toDsymbol(Scope
*sc
);
712 void toDecoBuffer(OutBuffer
*buf
, int flag
);
713 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
714 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
715 ClassDeclaration
*isClassHandle();
716 int isBaseOf(Type
*t
, target_ptrdiff_t
*poffset
);
717 MATCH
implicitConvTo(Type
*to
);
718 Expression
*defaultInit(Loc loc
);
720 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
723 TypeInfoDeclaration
*getTypeInfoDeclaration();
725 Type
*toHeadMutable();
726 MATCH
constConv(Type
*to
);
727 #if IN_GCC || TARGET_LINUX
728 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
736 struct TypeTuple
: Type
738 Arguments
*arguments
; // types making up the tuple
740 TypeTuple(Arguments
*arguments
);
741 TypeTuple(Expressions
*exps
);
743 Type
*semantic(Loc loc
, Scope
*sc
);
744 int equals(Object
*o
);
745 Type
*reliesOnTident();
746 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
747 void toDecoBuffer(OutBuffer
*buf
, int flag
);
748 Expression
*getProperty(Loc loc
, Identifier
*ident
);
749 TypeInfoDeclaration
*getTypeInfoDeclaration();
752 struct TypeSlice
: TypeNext
757 TypeSlice(Type
*next
, Expression
*lwr
, Expression
*upr
);
759 Type
*semantic(Loc loc
, Scope
*sc
);
760 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
761 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
764 /**************************************************************/
766 //enum InOut { None, In, Out, InOut, Lazy };
768 struct Argument
: Object
771 unsigned storageClass
;
774 Expression
*defaultArg
;
776 Argument(unsigned storageClass
, Type
*type
, Identifier
*ident
, Expression
*defaultArg
);
777 Argument
*syntaxCopy();
779 void toDecoBuffer(OutBuffer
*buf
);
780 static Arguments
*arraySyntaxCopy(Arguments
*args
);
781 static char *argsTypesToChars(Arguments
*args
, int varargs
);
782 static void argsCppMangle(OutBuffer
*buf
, CppMangleState
*cms
, Arguments
*arguments
, int varargs
);
783 static void argsToCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
, Arguments
*arguments
, int varargs
);
784 static void argsToDecoBuffer(OutBuffer
*buf
, Arguments
*arguments
);
785 static size_t dim(Arguments
*arguments
);
786 static Argument
*getNth(Arguments
*arguments
, size_t nth
, size_t *pn
= NULL
);
793 extern int Tptrdiff_t
;
797 #endif /* DMD_MTYPE_H */