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
112 typedef unsigned char TY
; // ENUMTY
119 extern int Tptrdiff_t
;
126 unsigned char mod
; // modifiers (MODconst, MODinvariant)
127 #define MODconst 1 // type is const
128 #define MODinvariant 2 // type is invariant
130 Type
*cto
; // MODconst ? mutable version of this type : const version
131 Type
*ito
; // MODinvariant ? mutable version of this type : invariant version
132 Type
*pto
; // merged pointer to this type
133 Type
*mbe
; // maybe null of this pointer or reference
134 Type
*rto
; // reference to this type
135 Type
*arrayof
; // array of this type
136 TypeInfoDeclaration
*vtinfo
; // TypeInfo object for this Type
138 type
*ctype
; // for back end
140 #define tvoid basic[Tvoid]
141 #define tint8 basic[Tint8]
142 #define tuns8 basic[Tuns8]
143 #define tint16 basic[Tint16]
144 #define tuns16 basic[Tuns16]
145 #define tint32 basic[Tint32]
146 #define tuns32 basic[Tuns32]
147 #define tint64 basic[Tint64]
148 #define tuns64 basic[Tuns64]
149 #define tfloat32 basic[Tfloat32]
150 #define tfloat64 basic[Tfloat64]
151 #define tfloat80 basic[Tfloat80]
153 #define timaginary32 basic[Timaginary32]
154 #define timaginary64 basic[Timaginary64]
155 #define timaginary80 basic[Timaginary80]
157 #define tcomplex32 basic[Tcomplex32]
158 #define tcomplex64 basic[Tcomplex64]
159 #define tcomplex80 basic[Tcomplex80]
161 #define tbit basic[Tbit]
162 #define tbool basic[Tbool]
163 #define tchar basic[Tchar]
164 #define twchar basic[Twchar]
165 #define tdchar basic[Tdchar]
167 // Some special types
168 #define tshiftcnt tint32 // right side of shift expression
169 // #define tboolean tint32 // result of boolean expression
170 #define tboolean tbool // result of boolean expression
171 #define tindex basic[Tindex] // array/ptr index
172 static Type
*tvoidptr
; // void*
173 #define terror basic[Terror] // for error recovery
175 #define tsize_t basic[Tsize_t] // matches size_t alias
176 #define tptrdiff_t basic[Tptrdiff_t] // matches ptrdiff_t alias
177 #define thash_t tsize_t // matches hash_t alias
179 static ClassDeclaration
*typeinfo
;
180 static ClassDeclaration
*typeinfoclass
;
181 static ClassDeclaration
*typeinfointerface
;
182 static ClassDeclaration
*typeinfostruct
;
183 static ClassDeclaration
*typeinfotypedef
;
184 static ClassDeclaration
*typeinfopointer
;
185 static ClassDeclaration
*typeinfoarray
;
186 static ClassDeclaration
*typeinfostaticarray
;
187 static ClassDeclaration
*typeinfoassociativearray
;
188 static ClassDeclaration
*typeinfoenum
;
189 static ClassDeclaration
*typeinfofunction
;
190 static ClassDeclaration
*typeinfodelegate
;
191 static ClassDeclaration
*typeinfotypelist
;
192 static ClassDeclaration
*typeinfoconst
;
193 static ClassDeclaration
*typeinfoinvariant
;
195 static Type
*basic
[TMAX
];
196 static unsigned char mangleChar
[TMAX
];
197 static unsigned char sizeTy
[TMAX
];
198 static StringTable stringtable
;
200 // These tables are for implicit conversion of binary ops;
201 // the indices are the type of operand one, followed by operand two.
202 static unsigned char impcnvResult
[TMAX
][TMAX
];
203 static unsigned char impcnvType1
[TMAX
][TMAX
];
204 static unsigned char impcnvType2
[TMAX
][TMAX
];
206 // If !=0, give warning on implicit conversion
207 static unsigned char impcnvWarn
[TMAX
][TMAX
];
210 virtual Type
*syntaxCopy();
211 int equals(Object
*o
);
212 int dyncast() { return DYNCAST_TYPE
; } // kludge for template.isType()
213 int covariant(Type
*t
);
215 static char needThisPrefix();
218 virtual d_uns64
size(Loc loc
);
219 virtual unsigned alignsize();
220 virtual Type
*semantic(Loc loc
, Scope
*sc
);
221 virtual void toDecoBuffer(OutBuffer
*buf
, int flag
= 0);
223 virtual void toCBuffer(OutBuffer
*buf
, Identifier
*ident
, HdrGenState
*hgs
);
224 virtual void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
225 void toCBuffer3(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
226 #if IN_GCC || TARGET_LINUX
227 virtual void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
229 virtual int isintegral();
230 virtual int isfloating(); // real, imaginary, or complex
231 virtual int isreal();
232 virtual int isimaginary();
233 virtual int iscomplex();
234 virtual int isscalar();
235 virtual int isunsigned();
236 virtual int isauto();
237 virtual int isString();
238 virtual int isAssignable();
239 virtual int checkBoolean(); // if can be converted to boolean value
240 virtual void checkDeprecated(Loc loc
, Scope
*sc
);
241 int isConst() { return mod
== MODconst
; }
242 int isInvariant() { return mod
== MODinvariant
; }
243 int isMutable() { return mod
== 0; }
248 Type
*maybe(bool merge
);
251 virtual Type
*makeConst();
252 virtual Type
*makeInvariant();
253 virtual Dsymbol
*toDsymbol(Scope
*sc
);
254 virtual Type
*toBasetype();
255 virtual Type
*toHeadMutable();
256 virtual int isBaseOf(Type
*t
, target_ptrdiff_t
*poffset
);
257 virtual MATCH
constConv(Type
*to
);
258 virtual MATCH
implicitConvTo(Type
*to
);
259 virtual ClassDeclaration
*isClassHandle();
260 virtual Expression
*getProperty(Loc loc
, Identifier
*ident
);
261 virtual Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
262 virtual unsigned memalign(unsigned salign
);
263 virtual Expression
*defaultInit(Loc loc
= 0);
264 virtual int isZeroInit(); // if initializer is 0
265 virtual dt_t
**toDt(dt_t
**pdt
);
266 Identifier
*getTypeInfoIdent(int internal
);
267 virtual MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
268 virtual void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
269 Expression
*getInternalTypeInfo(Scope
*sc
);
270 Expression
*getTypeInfo(Scope
*sc
);
271 virtual TypeInfoDeclaration
*getTypeInfoDeclaration();
272 virtual int builtinTypeInfo();
273 virtual Type
*reliesOnTident();
274 virtual Expression
*toExpression();
275 virtual int hasPointers();
276 virtual Type
*nextOf();
278 static void error(Loc loc
, const char *format
, ...);
281 virtual unsigned totym();
282 virtual type
*toCtype();
283 virtual type
*toCParamtype();
284 virtual Symbol
*toSymbol();
286 // For eliminating dynamic_cast
287 virtual TypeBasic
*isTypeBasic();
290 struct TypeNext
: Type
294 TypeNext(TY ty
, Type
*next
);
295 void toDecoBuffer(OutBuffer
*buf
, int flag
);
296 void checkDeprecated(Loc loc
, Scope
*sc
);
297 Type
*reliesOnTident();
300 Type
*makeInvariant();
301 MATCH
constConv(Type
*to
);
304 struct TypeBasic
: Type
311 d_uns64
size(Loc loc
);
312 unsigned alignsize();
313 Expression
*getProperty(Loc loc
, Identifier
*ident
);
314 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
316 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
317 #if IN_GCC || TARGET_LINUX
318 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
328 MATCH
implicitConvTo(Type
*to
);
329 Expression
*defaultInit(Loc loc
);
331 int builtinTypeInfo();
333 // For eliminating dynamic_cast
334 TypeBasic
*isTypeBasic();
337 struct TypeArray
: TypeNext
339 TypeArray(TY ty
, Type
*next
);
340 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
343 // Static array, one with a fixed dimension
344 struct TypeSArray
: TypeArray
348 TypeSArray(Type
*t
, Expression
*dim
);
350 d_uns64
size(Loc loc
);
351 unsigned alignsize();
352 Type
*semantic(Loc loc
, Scope
*sc
);
353 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
354 void toDecoBuffer(OutBuffer
*buf
, int flag
);
355 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
356 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
359 unsigned memalign(unsigned salign
);
360 MATCH
constConv(Type
*to
);
361 MATCH
implicitConvTo(Type
*to
);
362 Expression
*defaultInit(Loc loc
);
363 dt_t
**toDt(dt_t
**pdt
);
364 dt_t
**toDtElem(dt_t
**pdt
, Expression
*e
);
365 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
366 TypeInfoDeclaration
*getTypeInfoDeclaration();
367 Expression
*toExpression();
369 #if IN_GCC || TARGET_LINUX
370 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
374 type
*toCParamtype();
377 // Dynamic array, no dimension
378 struct TypeDArray
: TypeArray
382 d_uns64
size(Loc loc
);
383 unsigned alignsize();
384 Type
*semantic(Loc loc
, Scope
*sc
);
385 void toDecoBuffer(OutBuffer
*buf
, int flag
);
386 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
387 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
391 MATCH
implicitConvTo(Type
*to
);
392 Expression
*defaultInit(Loc loc
);
393 int builtinTypeInfo();
394 TypeInfoDeclaration
*getTypeInfoDeclaration();
396 #if IN_GCC || TARGET_LINUX
397 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
403 struct TypeAArray
: TypeArray
405 Type
*index
; // key type
407 TypeAArray(Type
*t
, Type
*index
);
409 d_uns64
size(Loc loc
);
410 Type
*semantic(Loc loc
, Scope
*sc
);
411 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
412 void toDecoBuffer(OutBuffer
*buf
, int flag
);
413 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
414 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
415 Expression
*defaultInit(Loc loc
);
416 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
418 TypeInfoDeclaration
*getTypeInfoDeclaration();
420 MATCH
implicitConvTo(Type
*to
);
421 MATCH
constConv(Type
*to
);
422 #if IN_GCC || TARGET_LINUX
423 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
427 Symbol
*aaGetSymbol(char *func
, int flags
);
432 struct TypePointer
: TypeNext
434 TypePointer(Type
*t
);
436 Type
*semantic(Loc loc
, Scope
*sc
);
437 d_uns64
size(Loc loc
);
438 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
439 MATCH
implicitConvTo(Type
*to
);
441 Expression
*defaultInit(Loc loc
);
443 TypeInfoDeclaration
*getTypeInfoDeclaration();
445 #if IN_GCC || TARGET_LINUX
446 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
452 struct TypeMaybe
: TypeNext
458 Type
*semantic(Loc loc
, Scope
*sc
);
459 d_uns64
size(Loc loc
);
460 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
461 MATCH
implicitConvTo(Type
*to
);
463 Expression
*defaultInit(Loc loc
);
465 TypeInfoDeclaration
*getTypeInfoDeclaration();
467 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
469 Expression
*getTypeInfo(Scope
*sc
);
474 struct TypeReference
: TypeNext
476 TypeReference(Type
*t
);
478 Type
*semantic(Loc loc
, Scope
*sc
);
479 d_uns64
size(Loc loc
);
480 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
481 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
482 Expression
*defaultInit(Loc loc
);
484 #if IN_GCC || TARGET_LINUX
485 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
491 RETregs
= 1, // returned in registers
492 RETstack
= 2, // returned on stack
495 struct TypeFunction
: TypeNext
497 // .next is the return type
499 Arguments
*parameters
; // function parameters
500 int varargs
; // 1: T t, ...) style for variable number of arguments
501 // 2: T t ...) style for variable number of arguments
502 bool isnothrow
; // true: nothrow
503 bool ispure
; // true: pure
504 enum LINK linkage
; // calling convention
508 TypeFunction(Arguments
*parameters
, Type
*treturn
, int varargs
, enum LINK linkage
);
510 Type
*semantic(Loc loc
, Scope
*sc
);
511 void toDecoBuffer(OutBuffer
*buf
, int flag
);
512 void toCBuffer(OutBuffer
*buf
, Identifier
*ident
, HdrGenState
*hgs
);
513 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
514 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
515 TypeInfoDeclaration
*getTypeInfoDeclaration();
516 Type
*reliesOnTident();
517 #if IN_GCC || TARGET_LINUX
518 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
521 int callMatch(Expression
*ethis
, Expressions
*toargs
);
528 struct TypeDelegate
: TypeNext
530 // .next is a TypeFunction
532 TypeDelegate(Type
*t
);
534 Type
*semantic(Loc loc
, Scope
*sc
);
535 d_uns64
size(Loc loc
);
536 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
537 Expression
*defaultInit(Loc loc
);
540 TypeInfoDeclaration
*getTypeInfoDeclaration();
541 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
543 #if IN_GCC || TARGET_LINUX
544 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
550 struct TypeQualified
: Type
553 Array idents
; // array of Identifier's representing ident.ident.ident etc.
555 TypeQualified(TY ty
, Loc loc
);
556 void syntaxCopyHelper(TypeQualified
*t
);
557 void addIdent(Identifier
*ident
);
558 void toCBuffer2Helper(OutBuffer
*buf
, HdrGenState
*hgs
);
559 d_uns64
size(Loc loc
);
560 void resolveHelper(Loc loc
, Scope
*sc
, Dsymbol
*s
, Dsymbol
*scopesym
,
561 Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
564 struct TypeIdentifier
: TypeQualified
567 bool maybe
; // If this turns out to be a type, wrap with TypeMaybe
569 TypeIdentifier(Loc loc
, Identifier
*ident
);
572 void toDecoBuffer(OutBuffer
*buf
, int flag
);
573 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
574 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
575 Dsymbol
*toDsymbol(Scope
*sc
);
576 Type
*semantic(Loc loc
, Scope
*sc
);
577 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
578 Type
*reliesOnTident();
579 Expression
*toExpression();
582 /* Similar to TypeIdentifier, but with a TemplateInstance as the root
584 struct TypeInstance
: TypeQualified
586 TemplateInstance
*tempinst
;
588 TypeInstance(Loc loc
, TemplateInstance
*tempinst
);
591 //void toDecoBuffer(OutBuffer *buf, int flag);
592 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
593 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
594 Type
*semantic(Loc loc
, Scope
*sc
);
595 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
598 struct TypeTypeof
: TypeQualified
602 TypeTypeof(Loc loc
, Expression
*exp
);
604 Dsymbol
*toDsymbol(Scope
*sc
);
605 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
606 Type
*semantic(Loc loc
, Scope
*sc
);
607 d_uns64
size(Loc loc
);
610 struct TypeReturn
: TypeQualified
614 Dsymbol
*toDsymbol(Scope
*sc
);
615 Type
*semantic(Loc loc
, Scope
*sc
);
616 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
619 struct TypeStruct
: Type
621 StructDeclaration
*sym
;
623 TypeStruct(StructDeclaration
*sym
);
624 d_uns64
size(Loc loc
);
625 unsigned alignsize();
628 Type
*semantic(Loc loc
, Scope
*sc
);
629 Dsymbol
*toDsymbol(Scope
*sc
);
630 void toDecoBuffer(OutBuffer
*buf
, int flag
);
631 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
632 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
633 unsigned memalign(unsigned salign
);
634 Expression
*defaultInit(Loc loc
);
638 dt_t
**toDt(dt_t
**pdt
);
639 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
640 TypeInfoDeclaration
*getTypeInfoDeclaration();
642 MATCH
implicitConvTo(Type
*to
);
643 MATCH
constConv(Type
*to
);
644 Type
*toHeadMutable();
645 #if IN_GCC || TARGET_LINUX
646 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
652 struct TypeEnum
: Type
654 EnumDeclaration
*sym
;
656 TypeEnum(EnumDeclaration
*sym
);
657 d_uns64
size(Loc loc
);
658 unsigned alignsize();
660 Type
*semantic(Loc loc
, Scope
*sc
);
661 Dsymbol
*toDsymbol(Scope
*sc
);
662 void toDecoBuffer(OutBuffer
*buf
, int flag
);
663 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
664 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
665 Expression
*getProperty(Loc loc
, Identifier
*ident
);
670 MATCH
implicitConvTo(Type
*to
);
671 MATCH
constConv(Type
*to
);
673 Expression
*defaultInit(Loc loc
);
675 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
676 TypeInfoDeclaration
*getTypeInfoDeclaration();
678 #if IN_GCC || TARGET_LINUX
679 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
685 struct TypeTypedef
: Type
687 TypedefDeclaration
*sym
;
689 TypeTypedef(TypedefDeclaration
*sym
);
691 d_uns64
size(Loc loc
);
692 unsigned alignsize();
694 Type
*semantic(Loc loc
, Scope
*sc
);
695 Dsymbol
*toDsymbol(Scope
*sc
);
696 void toDecoBuffer(OutBuffer
*buf
, int flag
);
697 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
698 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
699 Expression
*getProperty(Loc loc
, Identifier
*ident
);
711 MATCH
implicitConvTo(Type
*to
);
712 MATCH
constConv(Type
*to
);
713 Expression
*defaultInit(Loc loc
);
715 dt_t
**toDt(dt_t
**pdt
);
716 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
717 TypeInfoDeclaration
*getTypeInfoDeclaration();
719 Type
*toHeadMutable();
720 #if IN_GCC || TARGET_LINUX
721 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
725 type
*toCParamtype();
728 struct TypeClass
: Type
730 ClassDeclaration
*sym
;
732 TypeClass(ClassDeclaration
*sym
);
733 d_uns64
size(Loc loc
);
736 Type
*semantic(Loc loc
, Scope
*sc
);
737 Dsymbol
*toDsymbol(Scope
*sc
);
738 void toDecoBuffer(OutBuffer
*buf
, int flag
);
739 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
740 Expression
*dotExp(Scope
*sc
, Expression
*e
, Identifier
*ident
);
741 ClassDeclaration
*isClassHandle();
742 int isBaseOf(Type
*t
, target_ptrdiff_t
*poffset
);
743 MATCH
implicitConvTo(Type
*to
);
744 Expression
*defaultInit(Loc loc
);
746 MATCH
deduceType(Scope
*sc
, Type
*tparam
, TemplateParameters
*parameters
, Objects
*dedtypes
);
749 TypeInfoDeclaration
*getTypeInfoDeclaration();
751 Type
*toHeadMutable();
752 MATCH
constConv(Type
*to
);
753 #if IN_GCC || TARGET_LINUX
754 void toCppMangle(OutBuffer
*buf
, CppMangleState
*cms
);
762 struct TypeTuple
: Type
764 Arguments
*arguments
; // types making up the tuple
766 TypeTuple(Arguments
*arguments
);
767 TypeTuple(Expressions
*exps
);
769 Type
*semantic(Loc loc
, Scope
*sc
);
770 int equals(Object
*o
);
771 Type
*reliesOnTident();
772 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
773 void toDecoBuffer(OutBuffer
*buf
, int flag
);
774 Expression
*getProperty(Loc loc
, Identifier
*ident
);
775 TypeInfoDeclaration
*getTypeInfoDeclaration();
778 struct TypeSlice
: TypeNext
783 TypeSlice(Type
*next
, Expression
*lwr
, Expression
*upr
);
785 Type
*semantic(Loc loc
, Scope
*sc
);
786 void resolve(Loc loc
, Scope
*sc
, Expression
**pe
, Type
**pt
, Dsymbol
**ps
);
787 void toCBuffer2(OutBuffer
*buf
, HdrGenState
*hgs
, int mod
);
790 /**************************************************************/
792 //enum InOut { None, In, Out, InOut, Lazy };
794 struct Argument
: Object
797 unsigned storageClass
;
800 Expression
*defaultArg
;
802 Argument(unsigned storageClass
, Type
*type
, Identifier
*ident
, Expression
*defaultArg
);
803 Argument
*syntaxCopy();
805 void toDecoBuffer(OutBuffer
*buf
);
806 static Arguments
*arraySyntaxCopy(Arguments
*args
);
807 static char *argsTypesToChars(Arguments
*args
, int varargs
);
808 static void argsCppMangle(OutBuffer
*buf
, CppMangleState
*cms
, Arguments
*arguments
, int varargs
);
809 static void argsToCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
, Arguments
*arguments
, int varargs
);
810 static void argsToDecoBuffer(OutBuffer
*buf
, Arguments
*arguments
);
811 static size_t dim(Arguments
*arguments
);
812 static Argument
*getNth(Arguments
*arguments
, size_t nth
, size_t *pn
= NULL
);
819 extern int Tptrdiff_t
;
823 #endif /* DMD_MTYPE_H */