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, July 2007
17 /* A dt_t is a simple structure representing data to be added
18 * to the data segment of the output object file. As such,
19 * it is a list of initialized bytes, 0 data, and offsets from
21 * Each D symbol and type can be converted into a dt_t so it can
22 * be written to the data segment.
33 #define integer_t dmd_integer_t
38 #include "expression.h"
41 #include "aggregate.h"
42 #include "declaration.h"
56 extern Symbol
*static_sym();
58 /* ================================================================ */
61 static dt_t
*createTsarrayDt(dt_t
* elem_or_all
, Type
*t
)
63 assert(elem_or_all
!= NULL
);
64 target_size_t eoa_size
= dt_size(elem_or_all
);
65 if (eoa_size
== t
->size())
71 TypeSArray
* tsa
= (TypeSArray
*) t
->toBasetype();
72 assert(tsa
->ty
== Tsarray
);
74 target_size_t dim
= tsa
->dim
->toInteger();
78 if (eoa_size
* dim
== eoa_size
)
80 for (target_size_t i
= 0; i
< dim
; i
++)
81 padt
= dtcontainer(padt
, NULL
, elem_or_all
);
85 assert(tsa
->size(0) % eoa_size
== 0);
86 for (target_size_t i
= 0; i
< dim
; i
++)
87 padt
= dtcontainer(padt
, NULL
,
88 createTsarrayDt(elem_or_all
, tsa
->next
));
91 dtcontainer(& fdt
, t
, adt
);
98 dt_t
*Initializer::toDt()
105 dt_t
*VoidInitializer::toDt()
106 { /* Void initializers are set to 0, just because we need something
107 * to set them to in the static data segment.
111 dtnzeros(&dt
, type
->size());
116 dt_t
*StructInitializer::toDt()
124 target_size_t offset
;
126 //printf("StructInitializer::toDt('%s')\n", toChars());
127 dts
.setDim(ad
->fields
.dim
);
130 for (i
= 0; i
< vars
.dim
; i
++)
132 VarDeclaration
*v
= (VarDeclaration
*)vars
.data
[i
];
133 Initializer
*val
= (Initializer
*)value
.data
[i
];
135 //printf("vars[%d] = %s\n", i, v->toChars());
140 //printf(" adfield[%d] = %s\n", j, ((VarDeclaration *)ad->fields.data[j])->toChars());
141 if ((VarDeclaration
*)ad
->fields
.data
[j
] == v
)
144 error(loc
, "field %s of %s already initialized", v
->toChars(), ad
->toChars());
145 dts
.data
[j
] = (void *)val
->toDt();
154 for (j
= 0; j
< dts
.dim
; j
++)
156 VarDeclaration
*v
= (VarDeclaration
*)ad
->fields
.data
[j
];
158 d
= (dt_t
*)dts
.data
[j
];
160 { // An instance specific initializer was not provided.
161 // Look to see if there's a default initializer from the
163 VarDeclaration
*v
= (VarDeclaration
*)ad
->fields
.data
[j
];
169 else if (v
->offset
>= offset
)
172 target_size_t offset2
= v
->offset
+ v
->type
->size();
173 // Make sure this field does not overlap any explicitly
174 // initialized field.
175 for (k
= j
+ 1; 1; k
++)
177 if (k
== dts
.dim
) // didn't find any overlap
182 VarDeclaration
*v2
= (VarDeclaration
*)ad
->fields
.data
[k
];
184 if (v2
->offset
< offset2
&& dts
.data
[k
])
191 if (v
->offset
< offset
)
192 error(loc
, "duplicate union initialization for %s", v
->toChars());
194 { target_size_t sz
= dt_size(d
);
195 target_size_t vsz
= v
->type
->size();
196 target_size_t voffset
= v
->offset
;
200 if (offset
< voffset
)
201 pdtend
= dtnzeros(pdtend
, voffset
- offset
);
202 if (v
->type
->toBasetype()->ty
== Tsarray
)
204 d
= createTsarrayDt(d
, v
->type
);
208 pdtend
= dtcat(pdtend
, d
);
209 offset
= voffset
+ sz
;
211 target_size_t dim
= 1;
212 for (Type
*vt
= v
->type
->toBasetype();
214 vt
= vt
->nextOf()->toBasetype())
215 { TypeSArray
*tsa
= (TypeSArray
*)vt
;
216 dim
*= tsa
->dim
->toInteger();
219 for (target_size_t i
= 0; i
< dim
; i
++)
221 if (offset
< voffset
)
222 pdtend
= dtnzeros(pdtend
, voffset
- offset
);
230 pdtend
= dtcat(pdtend
, d
);
232 offset
= voffset
+ sz
;
233 voffset
+= vsz
/ dim
;
241 if (offset
< ad
->structsize
)
242 dtnzeros(pdtend
, ad
->structsize
- offset
);
246 dtcontainer(& cdt
, ad
->type
, dt
);
253 dt_t
*ArrayInitializer::toDt()
255 //printf("ArrayInitializer::toDt('%s')\n", toChars());
256 Type
*tb
= type
->toBasetype();
257 Type
*tn
= tb
->nextOf()->toBasetype();
267 //printf("\tdim = %d\n", dim);
274 for (i
= 0; i
< index
.dim
; i
++)
278 idx
= (Expression
*)index
.data
[i
];
280 length
= idx
->toInteger();
281 //printf("\tindex[%d] = %p, length = %u, dim = %u\n", i, idx, length, dim);
283 assert(length
< dim
);
284 val
= (Initializer
*)value
.data
[i
];
286 if (dts
.data
[length
])
287 error(loc
, "duplicate initializations for index %d", length
);
288 if (tn
->ty
== Tsarray
)
289 dt
= createTsarrayDt(dt
, tb
->nextOf());
290 dts
.data
[length
] = (void *)dt
;
294 Expression
*edefault
= tb
->nextOf()->defaultInit();
296 dt_t
* sadefault
= NULL
;
298 if (tn
->ty
== Tsarray
)
299 tn
->toDt(& sadefault
);
301 edefault
->toDt(& sadefault
);
304 for (Type
*tbn
= tn
; tbn
->ty
== Tsarray
; tbn
= tbn
->nextOf()->toBasetype())
305 { TypeSArray
*tsa
= (TypeSArray
*)tbn
;
307 n
*= tsa
->dim
->toInteger();
313 for (i
= 0; i
< dim
; i
++)
315 dt
= (dt_t
*)dts
.data
[i
];
317 pdtend
= dtcontainer(pdtend
, NULL
, dt
? dt
: sadefault
);
320 pdtend
= dtcat(pdtend
, dt
);
323 for (int j
= 0; j
< n
; j
++)
324 pdtend
= edefault
->toDt(pdtend
);
332 TypeSArray
*ta
= (TypeSArray
*)tb
;
334 tadim
= ta
->dim
->toInteger();
337 if (edefault
->isBool(FALSE
))
338 // pad out end of array
339 // (ok for GDC as well)
340 pdtend
= dtnzeros(pdtend
, size
* (tadim
- dim
));
343 for (i
= dim
; i
< tadim
; i
++)
345 pdtend
= dtcontainer(pdtend
, NULL
, sadefault
);
347 { for (int j
= 0; j
< n
; j
++)
348 pdtend
= edefault
->toDt(pdtend
);
353 else if (dim
> tadim
)
358 error(loc
, "too many initializers, %d, for array[%d]", dim
, tadim
);
362 dtcontainer(& cdt
, type
, d
);
370 // Create symbol, and then refer to it
377 if (tb
->ty
== Tarray
)
379 dtxoff(&d
, s
, 0, TYnptr
);
383 if (tb
->ty
== Tarray
)
384 dtcontainer(& cdt
, type
, d
);
396 dt_t
*ArrayInitializer::toDtBit()
405 Type
*tb
= type
->toBasetype();
410 if (tb
->ty
== Tsarray
)
412 /* The 'dim' for ArrayInitializer is only the maximum dimension
413 * seen in the initializer, not the type. So, for static arrays,
414 * use instead the dimension of the type in order
415 * to get the whole thing.
417 integer_t value
= ((TypeSArray
*)tb
)->dim
->toInteger();
419 assert(tadim
== value
); // truncation overflow should already be checked
420 databits
.resize(tadim
);
421 initbits
.resize(tadim
);
425 databits
.resize(dim
);
426 initbits
.resize(dim
);
429 /* The default initializer may be something other than zero.
431 if (tb
->nextOf()->defaultInit()->toInteger())
434 size
= sizeof(databits
.data
[0]);
437 for (i
= 0; i
< index
.dim
; i
++)
442 idx
= (Expression
*)index
.data
[i
];
445 value
= idx
->toInteger();
448 { error(loc
, "index overflow %llu", value
);
452 assert(length
< dim
);
454 val
= (Initializer
*)value
.data
[i
];
455 eval
= val
->toExpression();
456 if (initbits
.test(length
))
457 error(loc
, "duplicate initializations for index %d", length
);
458 initbits
.set(length
);
459 if (eval
->toInteger()) // any non-zero value is boolean 'true'
460 databits
.set(length
);
462 databits
.clear(length
); // boolean 'false'
468 pdtend
= dtnbits(&d
, databits
.allocdim
* size
, (char *)databits
.data
, sizeof(databits
.data
[0]));
470 pdtend
= dtnbytes(&d
, databits
.allocdim
* size
, (char *)databits
.data
);
481 error(loc
, "too many initializers, %d, for array[%d]", dim
, tadim
);
485 tadim
= (tadim
+ 31) / 32;
486 if (databits
.allocdim
< tadim
)
487 pdtend
= dtnzeros(pdtend
, size
* (tadim
- databits
.allocdim
)); // pad out end of array
494 // Create symbol, and then refer to it
501 if (tb
->ty
== Tarray
)
503 dtxoff(&d
, s
, 0, TYnptr
);
516 dt_t
*ExpInitializer::toDt()
520 exp
= exp
->optimize(WANTvalue
);
525 /* ================================================================ */
527 dt_t
**Expression::toDt(dt_t
**pdt
)
530 printf("Expression::toDt() %d\n", op
);
533 error("non-constant expression %s", toChars());
534 pdt
= dtnzeros(pdt
, 1);
540 dt_t
**IntegerExp::toDt(dt_t
**pdt
)
543 //printf("IntegerExp::toDt() %d\n", op);
546 pdt
= dtnzeros(pdt
, sz
);
548 pdt
= dtnbytes(pdt
, sz
, (char *)&value
);
552 static char zeropad
[2];
554 dt_t
**RealExp::toDt(dt_t
**pdt
)
560 //printf("RealExp::toDt(%Lg)\n", value);
561 switch (type
->toBasetype()->ty
)
566 pdt
= dtnbytes(pdt
,4,(char *)&fvalue
);
572 pdt
= dtnbytes(pdt
,8,(char *)&dvalue
);
578 pdt
= dtnbytes(pdt
,REALSIZE
- REALPAD
,(char *)&evalue
);
579 pdt
= dtnbytes(pdt
,REALPAD
,zeropad
);
583 fprintf(stderr
, "%s\n", toChars());
591 dt_t
**ComplexExp::toDt(dt_t
**pdt
)
593 //printf("ComplexExp::toDt() '%s'\n", toChars());
598 switch (type
->toBasetype()->ty
)
601 fvalue
= creall(value
);
602 pdt
= dtnbytes(pdt
,4,(char *)&fvalue
);
603 fvalue
= cimagl(value
);
604 pdt
= dtnbytes(pdt
,4,(char *)&fvalue
);
608 dvalue
= creall(value
);
609 pdt
= dtnbytes(pdt
,8,(char *)&dvalue
);
610 dvalue
= cimagl(value
);
611 pdt
= dtnbytes(pdt
,8,(char *)&dvalue
);
615 evalue
= creall(value
);
616 pdt
= dtnbytes(pdt
,REALSIZE
- REALPAD
,(char *)&evalue
);
617 pdt
= dtnbytes(pdt
,REALPAD
,zeropad
);
618 evalue
= cimagl(value
);
619 pdt
= dtnbytes(pdt
,REALSIZE
- REALPAD
,(char *)&evalue
);
620 pdt
= dtnbytes(pdt
,REALPAD
,zeropad
);
633 dt_t
**NullExp::toDt(dt_t
**pdt
)
636 return dtnzeros(pdt
, type
->size());
639 dt_t
**StringExp::toDt(dt_t
**pdt
)
641 //printf("StringExp::toDt() '%s', type = %s\n", toChars(), type->toChars());
642 Type
*t
= type
->toBasetype();
644 // BUG: should implement some form of static string pooling
648 dt_t
* adt
; adt
= NULL
;
651 dtabytes(& adt
, TYnptr
, 0, (len
+ 1) * sz
, (char *)string
);
652 pdt
= dcat(pdt
, adt
);
654 dtawords(& adt
, len
+ 1, string
, sz
);
655 pdt
= dtcontainer(pdt
, type
, adt
);
661 { TypeSArray
*tsa
= (TypeSArray
*)type
;
665 pdt
= dtnbytes(pdt
, len
* sz
, (const char *)string
);
667 pdt
= dtnwords(pdt
, len
, string
, sz
);
671 dim
= tsa
->dim
->toInteger();
674 // Pad remainder with 0
675 pdt
= dtnzeros(pdt
, (dim
- len
) * tsa
->next
->size());
682 pdt
= dtabytes(pdt
, TYnptr
, 0, (len
+ 1) * sz
, (char *)string
);
684 pdt
= dtawords(pdt
, len
+ 1, string
, sz
);
689 fprintf(stderr
, "StringExp::toDt(type = %s)\n", type
->toChars());
695 dt_t
**ArrayLiteralExp::toDt(dt_t
**pdt
)
697 //printf("ArrayLiteralExp::toDt() '%s', type = %s\n", toChars(), type->toChars());
704 for (int i
= 0; i
< elements
->dim
; i
++)
705 { Expression
*e
= (Expression
*)elements
->data
[i
];
707 pdtend
= e
->toDt(pdtend
);
711 dtcontainer(& cdt
, type
, d
);
714 Type
*t
= type
->toBasetype();
724 dt_t
* adt
; adt
= NULL
;
726 dtdword(& adt
, elements
->dim
);
729 // Create symbol, and then refer to it
735 dtxoff(& adt
, s
, 0, TYnptr
);
741 dtcontainer(pdt
, type
, adt
);
754 dt_t
**StructLiteralExp::toDt(dt_t
**pdt
)
762 target_size_t offset
;
764 //printf("StructLiteralExp::toDt() %s)\n", toChars());
765 dts
.setDim(sd
->fields
.dim
);
767 assert(elements
->dim
<= sd
->fields
.dim
);
769 for (i
= 0; i
< elements
->dim
; i
++)
771 Expression
*e
= (Expression
*)elements
->data
[i
];
776 dts
.data
[i
] = (void *)dt
;
780 for (j
= 0; j
< dts
.dim
; j
++)
782 VarDeclaration
*v
= (VarDeclaration
*)sd
->fields
.data
[j
];
784 d
= (dt_t
*)dts
.data
[j
];
786 { // An instance specific initializer was not provided.
787 // Look to see if there's a default initializer from the
789 VarDeclaration
*v
= (VarDeclaration
*)sd
->fields
.data
[j
];
795 else if (v
->offset
>= offset
)
798 target_size_t offset2
= v
->offset
+ v
->type
->size();
799 // Make sure this field (v) does not overlap any explicitly
800 // initialized field.
801 for (k
= j
+ 1; 1; k
++)
803 if (k
== dts
.dim
) // didn't find any overlap
808 VarDeclaration
*v2
= (VarDeclaration
*)sd
->fields
.data
[k
];
810 if (v2
->offset
< offset2
&& dts
.data
[k
])
817 if (v
->offset
< offset
)
818 error("duplicate union initialization for %s", v
->toChars());
820 { target_size_t sz
= dt_size(d
);
821 target_size_t vsz
= v
->type
->size();
822 target_size_t voffset
= v
->offset
;
826 if (offset
< voffset
)
827 dtnzeros(& sdt
, voffset
- offset
);
828 if (v
->type
->toBasetype()->ty
== Tsarray
)
830 d
= createTsarrayDt(d
, v
->type
);
835 offset
= voffset
+ sz
;
837 target_size_t dim
= 1;
838 for (Type
*vt
= v
->type
->toBasetype();
840 vt
= vt
->nextOf()->toBasetype())
841 { TypeSArray
*tsa
= (TypeSArray
*)vt
;
842 dim
*= tsa
->dim
->toInteger();
845 for (target_size_t i
= 0; i
< dim
; i
++)
847 if (offset
< voffset
)
848 dtnzeros(& sdt
, voffset
- offset
);
858 offset
= voffset
+ sz
;
859 voffset
+= vsz
/ dim
;
867 if (offset
< sd
->structsize
)
868 dtnzeros(& sdt
, sd
->structsize
- offset
);
870 dtcontainer(pdt
, type
, sdt
);
872 pdt
= dtcat(pdt
, sdt
);
879 dt_t
**SymOffExp::toDt(dt_t
**pdt
)
883 //printf("SymOffExp::toDt('%s')\n", var->toChars());
885 if (!(var
->isDataseg() || var
->isCodeseg()) ||
887 var
->storage_class
& STCtls
)
890 printf("SymOffExp::toDt()\n");
892 error("non-constant expression %s", toChars());
896 return dtxoff(pdt
, s
, offset
, TYnptr
);
899 dt_t
**VarExp::toDt(dt_t
**pdt
)
901 //printf("VarExp::toDt() %d\n", op);
902 for (; *pdt
; pdt
= &((*pdt
)->DTnext
))
905 VarDeclaration
*v
= var
->isVarDeclaration();
906 if (v
&& (v
->isConst() || v
->isInvariant()) &&
907 type
->toBasetype()->ty
!= Tsarray
&& v
->init
)
909 *pdt
= v
->init
->toDt();
912 SymbolDeclaration
*sd
= var
->isSymbolDeclaration();
919 printf("VarExp::toDt(), kind = %s\n", var
->kind());
921 error("non-constant expression %s", toChars());
922 pdt
= dtnzeros(pdt
, 1);
926 /* ================================================================= */
928 // Generate the data for the static initializer.
930 void ClassDeclaration::toDt(dt_t
**pdt
)
932 //printf("ClassDeclaration::toDt(this = '%s')\n", toChars());
934 // Put in first two members, the vtbl[] and the monitor
935 dtxoff(pdt
, toVtblSymbol(), 0, TYnptr
);
936 dtdword(pdt
, 0); // monitor
941 //printf("-ClassDeclaration::toDt(this = '%s')\n", toChars());
944 void ClassDeclaration::toDt2(dt_t
**pdt
, ClassDeclaration
*cd
)
954 printf("ClassDeclaration::toDt2(this = '%s', cd = '%s')\n", toChars(), cd
->toChars());
958 baseClass
->toDt2(pdt
, cd
);
959 offset
= baseClass
->structsize
;
963 offset
= PTRSIZE
* 2;
966 // Note equivalence of this loop to struct's
967 for (i
= 0; i
< fields
.dim
; i
++)
969 VarDeclaration
*v
= (VarDeclaration
*)fields
.data
[i
];
972 //printf("\t\tv = '%s' v->offset = %2d, offset = %2d\n", v->toChars(), v->offset, offset);
976 { //printf("\t\t%s has initializer %s\n", v->toChars(), init->toChars());
977 ExpInitializer
*ei
= init
->isExpInitializer();
978 Type
*tb
= v
->type
->toBasetype();
979 if (ei
&& tb
->ty
== Tsarray
)
983 dt
= createTsarrayDt(dt
, v
->type
);
985 ((TypeSArray
*)tb
)->toDtElem(&dt
, ei
->exp
);
991 else if (v
->offset
>= offset
)
992 { //printf("\t\tdefault initializer\n");
997 if (v
->offset
< offset
)
998 error("2duplicate union initialization for %s", v
->toChars());
1001 if (offset
< v
->offset
)
1002 dtnzeros(pdt
, v
->offset
- offset
);
1004 offset
= v
->offset
+ v
->type
->size();
1009 // Interface vptr initializations
1010 toSymbol(); // define csym
1012 for (i
= 0; i
< vtblInterfaces
->dim
; i
++)
1013 { BaseClass
*b
= (BaseClass
*)vtblInterfaces
->data
[i
];
1015 #if 1 || INTERFACE_VIRTUAL
1016 for (ClassDeclaration
*cd2
= cd
; 1; cd2
= cd2
->baseClass
)
1019 csymoffset
= cd2
->baseVtblOffset(b
);
1020 if (csymoffset
!= ~0)
1022 if (offset
< b
->offset
)
1023 dtnzeros(pdt
, b
->offset
- offset
);
1024 dtxoff(pdt
, cd2
->toSymbol(), csymoffset
, TYnptr
);
1029 csymoffset
= baseVtblOffset(b
);
1030 assert(csymoffset
!= ~0);
1031 dtxoff(pdt
, csym
, csymoffset
, TYnptr
);
1033 offset
= b
->offset
+ PTRSIZE
;
1036 if (offset
< structsize
)
1037 dtnzeros(pdt
, structsize
- offset
);
1042 void StructDeclaration::toDt(dt_t
**pdt
)
1046 dtnzeros(pdt
, structsize
);
1055 //printf("StructDeclaration::toDt(), this='%s'\n", toChars());
1058 // Note equivalence of this loop to class's
1059 for (i
= 0; i
< fields
.dim
; i
++)
1061 VarDeclaration
*v
= (VarDeclaration
*)fields
.data
[i
];
1064 //printf("\tfield '%s' voffset %d, offset = %d\n", v->toChars(), v->offset, offset);
1068 { //printf("\t\thas initializer %s\n", init->toChars());
1069 ExpInitializer
*ei
= init
->isExpInitializer();
1070 Type
*tb
= v
->type
->toBasetype();
1071 if (ei
&& tb
->ty
== Tsarray
)
1075 dt
= createTsarrayDt(dt
, v
->type
);
1077 ((TypeSArray
*)tb
)->toDtElem(&dt
, ei
->exp
);
1083 else if (v
->offset
>= offset
)
1087 if (v
->offset
< offset
)
1088 error("overlapping initialization for struct %s.%s", toChars(), v
->toChars());
1091 if (offset
< v
->offset
)
1092 dtnzeros(& sdt
, v
->offset
- offset
);
1094 offset
= v
->offset
+ v
->type
->size();
1099 if (offset
< structsize
)
1100 dtnzeros(& sdt
, structsize
- offset
);
1102 dtcontainer(pdt
, type
, sdt
);
1110 /* ================================================================= */
1112 dt_t
**Type::toDt(dt_t
**pdt
)
1114 //printf("Type::toDt()\n");
1115 Expression
*e
= defaultInit();
1116 return e
->toDt(pdt
);
1119 dt_t
**TypeSArray::toDt(dt_t
**pdt
)
1121 return toDtElem(pdt
, NULL
);
1124 dt_t
**TypeSArray::toDtElem(dt_t
**pdt
, Expression
*e
)
1129 //printf("TypeSArray::toDtElem()\n");
1130 len
= dim
->toInteger();
1134 pdt
= &((*pdt
)->DTnext
);
1136 Type
*tbn
= tnext
->toBasetype();
1137 while (tbn
->ty
== Tsarray
)
1138 { TypeSArray
*tsa
= (TypeSArray
*)tbn
;
1140 len
*= tsa
->dim
->toInteger();
1141 tnext
= tbn
->nextOf();
1142 tbn
= tnext
->toBasetype();
1144 if (!e
) // if not already supplied
1145 e
= tnext
->defaultInit(); // use default initializer
1147 dt_t
**padt
= & adt
;
1149 if (tbn->ty == Tstruct)
1157 // These first two cases are okay for GDC too
1158 if ((*padt
)->dt
== DT_azeros
&& !(*padt
)->DTnext
)
1160 (*padt
)->DTazeros
*= len
;
1161 pdt
= dtcat(pdt
, adt
);
1163 else if ((*padt
)->dt
== DT_1byte
&& (*padt
)->DTonebyte
== 0 && !(*padt
)->DTnext
)
1165 (*padt
)->dt
= DT_azeros
;
1166 (*padt
)->DTazeros
= len
;
1167 pdt
= dtcat(pdt
, adt
);
1169 else if (e
->op
!= TOKstring
)
1172 pdt
= dtcat(pdt
, createTsarrayDt(adt
, this));
1174 for (i
= 1; i
< len
; i
++)
1176 if (tbn
->ty
== Tstruct
)
1177 { padt
= tnext
->toDt(padt
);
1179 pdt
= &((*padt
)->DTnext
);
1182 padt
= e
->toDt(padt
);
1184 pdt
= dtcat(pdt
, adt
);
1191 dt_t
**TypeStruct::toDt(dt_t
**pdt
)
1197 dt_t
**TypeTypedef::toDt(dt_t
**pdt
)
1201 dt_t
*dt
= sym
->init
->toDt();
1204 pdt
= &((*pdt
)->DTnext
);
1208 sym
->basetype
->toDt(pdt
);