Changeset 769
- Timestamp:
- 11/29/10 02:00:46 (14 years ago)
- Files:
-
- trunk/src/backend/cgen.c (modified) (5 diffs)
- trunk/src/expression.c (modified) (1 diff)
- trunk/src/freebsd.mak (modified) (2 diffs)
- trunk/src/lexer.c (modified) (1 diff)
- trunk/src/lexer.h (modified) (1 diff)
- trunk/src/linux.mak (modified) (2 diffs)
- trunk/src/mtype.c (modified) (2 diffs)
- trunk/src/mtype.h (modified) (7 diffs)
- trunk/src/osx.mak (modified) (2 diffs)
- trunk/src/parse.c (modified) (1 diff)
- trunk/src/solaris.mak (modified) (2 diffs)
- trunk/src/typinf.c (modified) (1 diff)
- trunk/src/win32.mak (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/backend/cgen.c
r738 r769 8 8 * only. The license is in /dmd/src/dmd/backendlicense.txt 9 9 * or /dm/src/dmd/backendlicense.txt 10 10 * For any other uses, please contact Digital Mars. 11 11 */ 12 12 13 13 #if !SPP 14 14 15 15 #include <stdio.h> 16 16 #include <string.h> 17 17 #include <time.h> 18 18 #include "cc.h" 19 19 #include "el.h" 20 20 #include "oper.h" 21 21 #include "code.h" 22 22 #include "type.h" 23 23 #include "global.h" 24 24 25 25 static char __file__[] = __FILE__; /* for tassert.h */ 26 26 #include "tassert.h" 27 27 28 /************************************* 29 * Handy function to answer the question: who the heck is generating this piece of code? 30 */ 31 inline void ccheck(code *cs) 32 { 33 // if (cs->Iop == LEA && (cs->Irm & 0x3F) == 0x34 && cs->Isib == 7) *(char*)0=0; 34 } 35 28 36 /***************************** 29 37 * Find last code in list. 30 38 */ 31 39 32 40 code *code_last(code *c) 33 41 { 34 42 if (c) 35 43 { while (c->next) 36 44 c = c->next; 37 45 } 38 46 return c; 39 47 } 40 48 41 49 /***************************** 42 50 * Set flag bits on last code in list. 43 51 */ 44 52 45 53 void code_orflag(code *c,unsigned flag) 46 54 { 47 55 if (flag && c) … … 145 153 * Note that unused operands are garbage. 146 154 * gen1() and gen2() are shortcut routines. 147 155 * Input: 148 156 * c -> linked list that code is to be added to end of 149 157 * cs -> data for the code 150 158 * Returns: 151 159 * pointer to start of code list 152 160 */ 153 161 154 162 code *gen(code *c,code *cs) 155 163 { code *ce,*cstart; 156 164 unsigned reg; 157 165 158 166 #ifdef DEBUG /* this is a high usage routine */ 159 167 assert(cs); 160 168 #endif 161 169 assert(I64 || cs->Irex == 0); 162 170 ce = code_calloc(); 163 171 *ce = *cs; 164 172 //printf("ce = %p %02x\n", ce, ce->Iop); 165 if (ce->Iop == LEA && ce->Irm == 4 && ce->Isib == 0x6D && ce->IFL1 == FLunde) *(char*)0=0;173 ccheck(ce); 166 174 if (config.flags4 & CFG4optimized && 167 175 ce->IFL2 == FLconst && 168 176 (ce->Iop == 0x81 || ce->Iop == 0x80) && 169 177 reghasvalue((ce->Iop == 0x80) ? BYTEREGS : ALLREGS,ce->IEV2.Vlong,®) && 170 178 !(ce->Iflags & CFopsize && I16) 171 179 ) 172 180 { // See if we can replace immediate instruction with register instruction 173 181 static unsigned char regop[8] = 174 182 { 0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38 }; 175 183 176 184 //printf("replacing 0x%02x, val = x%lx\n",ce->Iop,ce->IEV2.Vlong); 177 185 ce->Iop = regop[(ce->Irm & modregrm(0,7,0)) >> 3] | (ce->Iop & 1); 178 186 code_newreg(ce, reg); 179 187 } 180 188 code_next(ce) = CNIL; 181 189 if (c) 182 190 { cstart = c; 183 191 while (code_next(c)) c = code_next(c); /* find end of list */ 184 192 code_next(c) = ce; /* link into list */ 185 193 return cstart; … … 192 200 193 201 ce = code_calloc(); 194 202 ce->Iop = op; 195 203 assert(op != LEA); 196 204 if (c) 197 205 { cstart = c; 198 206 while (code_next(c)) c = code_next(c); /* find end of list */ 199 207 code_next(c) = ce; /* link into list */ 200 208 return cstart; 201 209 } 202 210 return ce; 203 211 } 204 212 205 213 code *gen2(code *c,unsigned op,unsigned rm) 206 214 { code *ce,*cstart; 207 215 208 216 cstart = ce = code_calloc(); 209 217 /*cxcalloc++;*/ 210 218 ce->Iop = op; 211 219 ce->Iea = rm; 220 ccheck(ce); 212 221 if (c) 213 222 { cstart = c; 214 223 while (code_next(c)) c = code_next(c); /* find end of list */ 215 224 code_next(c) = ce; /* link into list */ 216 225 } 217 226 return cstart; 218 227 } 219 228 220 229 code *gen2sib(code *c,unsigned op,unsigned rm,unsigned sib) 221 230 { code *ce,*cstart; 222 231 223 232 cstart = ce = code_calloc(); 224 233 /*cxcalloc++;*/ 225 if (op == LEA && (rm & 0xFF) == 4 && (sib & 0xFF) == 0x6D) *(char*)0=0;226 234 ce->Iop = op; 227 235 ce->Irm = rm; 228 236 ce->Isib = sib; 229 237 ce->Irex = (rm | (sib & (REX_B << 16))) >> 16; 230 238 if (sib & (REX_R << 16)) 231 239 ce->Irex |= REX_X; 240 ccheck(ce); 232 241 if (c) 233 242 { cstart = c; 234 243 while (code_next(c)) c = code_next(c); /* find end of list */ 235 244 code_next(c) = ce; /* link into list */ 236 245 } 237 246 return cstart; 238 247 } 239 248 240 249 code *genregs(code *c,unsigned op,unsigned dstreg,unsigned srcreg) 241 250 { return gen2(c,op,modregxrmx(3,dstreg,srcreg)); } 242 251 243 252 code *gentstreg(code *c,unsigned t) 244 253 { 245 254 c = gen2(c,0x85,modregxrmx(3,t,t)); // TEST t,t 246 255 code_orflag(c,CFpsw); 247 256 return c; 248 257 } 249 258 250 259 code *genpush(code *c, unsigned reg) 251 260 { … … 342 351 c = genjmp(c,JP,FLcode,(block *) cnop); 343 352 cat(cj,cnop); 344 353 break; 345 354 case 1 << 8: /* toggled no jump */ 346 355 case 0 << 8: 347 356 break; 348 357 default: 349 358 #ifdef DEBUG 350 359 printf("jop = x%x\n",op); 351 360 #endif 352 361 assert(0); 353 362 } 354 363 return cat(c,cj); 355 364 } 356 365 357 366 code *gencs(code *c,unsigned op,unsigned ea,unsigned FL2,symbol *s) 358 367 { code cs; 359 368 360 369 cs.Iop = op; 361 370 cs.Iea = ea; 371 ccheck(&cs); 362 372 cs.Iflags = 0; 363 373 cs.IFL2 = FL2; 364 374 cs.IEVsym2 = s; 365 375 cs.IEVoffset2 = 0; 366 376 367 377 return gen(c,&cs); 368 378 } 369 379 370 380 code *genc2(code *c,unsigned op,unsigned ea,targ_size_t EV2) 371 381 { code cs; 372 382 373 383 cs.Iop = op; 374 384 cs.Iea = ea; 385 ccheck(&cs); 375 386 cs.Iflags = CFoff; 376 387 cs.IFL2 = FLconst; 377 388 cs.IEV2.Vsize_t = EV2; 378 389 return gen(c,&cs); 379 390 } 380 391 381 392 /***************** 382 393 * Generate code. 383 394 */ 384 395 385 396 code *genc1(code *c,unsigned op,unsigned ea,unsigned FL1,targ_size_t EV1) 386 397 { code cs; 387 398 388 399 assert(FL1 < FLMAX); 389 400 cs.Iop = op; 390 401 cs.Iflags = CFoff; 391 402 cs.Iea = ea; 403 ccheck(&cs); 392 404 cs.IFL1 = FL1; 393 405 cs.IEV1.Vsize_t = EV1; 394 if (cs.Iop == LEA && cs.IFL1 == FLunde) *(char*)0=0;395 406 return gen(c,&cs); 396 407 } 397 408 398 409 /***************** 399 410 * Generate code. 400 411 */ 401 412 402 413 code *genc(code *c,unsigned op,unsigned ea,unsigned FL1,targ_size_t EV1,unsigned FL2,targ_size_t EV2) 403 414 { code cs; 404 415 405 416 assert(FL1 < FLMAX); 406 417 cs.Iop = op; 407 418 cs.Iea = ea; 419 ccheck(&cs); 408 420 cs.Iflags = CFoff; 409 421 cs.IFL1 = FL1; 410 422 cs.IEV1.Vsize_t = EV1; 411 423 assert(FL2 < FLMAX); 412 424 cs.IFL2 = FL2; 413 425 cs.IEV2.Vsize_t = EV2; 414 426 return gen(c,&cs); 415 427 } 416 428 417 429 /*************************************** 418 430 * Generate immediate multiply instruction for r1=r2*imm. 419 431 * Optimize it into LEA's if we can. 420 432 */ 421 433 422 434 code *genmulimm(code *c,unsigned r1,unsigned r2,targ_int imm) 423 435 { code cs; 424 436 425 437 // These optimizations should probably be put into pinholeopt() 426 438 switch (imm) 427 439 { case 1: … … 539 551 * set flags based on result 540 552 * Else if flags & 8 541 553 * do not disturb flags 542 554 * Else 543 555 * don't care about flags 544 556 * If flags & 1 then byte move 545 557 * If flags & 2 then short move (for I32 and I64) 546 558 * If flags & 4 then don't disturb unused portion of register 547 559 * If flags & 16 then reg is a byte register AL..BH 548 560 * If flags & 64 then 64 bit move (I64 only) 549 561 * Returns: 550 562 * code (if any) generated 551 563 */ 552 564 553 565 code *movregconst(code *c,unsigned reg,targ_size_t value,regm_t flags) 554 566 { unsigned r; 555 567 regm_t regm; 556 568 regm_t mreg; 557 569 targ_size_t regv; 558 570 571 //printf("movregconst(%llx)\n", value); 559 572 #define genclrreg(a,r) genregs(a,0x31,r,r) 560 573 561 574 regm = regcon.immed.mval & mask[reg]; 562 575 regv = regcon.immed.value[reg]; 563 576 564 577 if (flags & 1) // 8 bits 565 578 { unsigned msk; 566 579 567 580 value &= 0xFF; 568 581 regm &= BYTEREGS; 569 582 570 583 // If we already have the right value in the right register 571 584 if (regm && (regv & 0xFF) == value) 572 585 goto L2; 573 586 574 587 if (flags & 16 && reg & 4 && // if an H byte register 575 588 regcon.immed.mval & mask[reg & 3] && 576 589 (((regv = regcon.immed.value[reg & 3]) >> 8) & 0xFF) == value) 577 590 goto L2; 578 591 trunk/src/expression.c
r767 r769 5073 5073 } 5074 5074 case TOKreturn: 5075 5075 /* Get the 'return type' for the function, 5076 5076 * delegate, or pointer to function. 5077 5077 */ 5078 5078 if (targ->ty == Tfunction) 5079 5079 tded = ((TypeFunction *)targ)->next; 5080 5080 else if (targ->ty == Tdelegate) 5081 5081 { tded = ((TypeDelegate *)targ)->next; 5082 5082 tded = ((TypeFunction *)tded)->next; 5083 5083 } 5084 5084 else if (targ->ty == Tpointer && 5085 5085 ((TypePointer *)targ)->next->ty == Tfunction) 5086 5086 { tded = ((TypePointer *)targ)->next; 5087 5087 tded = ((TypeFunction *)tded)->next; 5088 5088 } 5089 5089 else 5090 5090 goto Lno; 5091 5091 break; 5092 5092 5093 case TOKargTypes: 5094 /* Generate a type tuple of the equivalent types used to determine if a 5095 * function argument of this type can be passed in registers. 5096 * The results of this are highly platform dependent, and intended 5097 * primarly for use in implementing va_arg(). 5098 */ 5099 tded = targ->toArgTypes(); 5100 if (!tded) 5101 goto Lno; // not valid for a parameter 5102 break; 5103 5093 5104 default: 5094 5105 assert(0); 5095 5106 } 5096 5107 goto Lyes; 5097 5108 } 5098 5109 else if (id && tspec) 5099 5110 { 5100 5111 /* Evaluate to TRUE if targ matches tspec. 5101 5112 * If TRUE, declare id as an alias for the specialized type. 5102 5113 */ 5103 5114 5104 5115 assert(parameters && parameters->dim); 5105 5116 5106 5117 Objects dedtypes; 5107 5118 dedtypes.setDim(parameters->dim); 5108 5119 dedtypes.zero(); 5109 5120 5110 5121 MATCH m = targ->deduceType(NULL, tspec, parameters, &dedtypes); 5111 5122 //printf("targ: %s\n", targ->toChars()); 5112 5123 //printf("tspec: %s\n", tspec->toChars()); trunk/src/freebsd.mak
r605 r769 25 25 TOTALH= 26 26 27 27 DMD_OBJS = \ 28 28 access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 29 29 cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 30 30 cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 31 31 constfold.o irstate.o dchar.o cond.o debug.o \ 32 32 declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 33 33 dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 34 34 glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 35 35 identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 36 36 lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 37 37 nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 38 38 parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 39 39 stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 40 40 type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 41 41 unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 42 42 hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 43 43 builtin.o clone.o aliasthis.o \ 44 44 man.o arrayop.o port.o response.o async.o json.o speller.o aav.o unittests.o \ 45 imphint.o \45 imphint.o argtypes.o \ 46 46 libelf.o elfobj.o 47 47 48 48 SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 49 49 mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 50 50 identifier.c mtype.c expression.c optimize.c template.h \ 51 51 template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 52 52 aggregate.h parse.c statement.c constfold.c version.h version.c \ 53 53 inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 54 54 attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 55 55 access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 56 56 s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 57 57 scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 58 58 declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 59 59 utf.h utf.c staticassert.h staticassert.c unialpha.c \ 60 60 typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 61 61 doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 62 62 delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 63 63 builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 64 64 aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 65 argtypes.c \ 65 66 $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 66 67 $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 67 68 $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 68 69 $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 69 70 $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 70 71 $C/cgreg.c $C/var.c $C/strtold.c \ 71 72 $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 72 73 $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 73 74 $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 74 75 $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 75 76 $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 76 77 $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 77 78 $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 78 79 $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 79 80 $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 80 81 $C/machobj.c \ 81 82 $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 82 83 $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 83 84 $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 84 85 $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ … … 125 126 $(impcnvtab_output) : impcnvgen 126 127 127 128 impcnvgen : mtype.h impcnvgen.c 128 129 $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 129 130 ./impcnvgen 130 131 131 132 ######### 132 133 133 134 $(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 134 135 135 136 aa.o: $C/aa.h $C/tinfo.h $C/aa.c 136 137 $(CC) -c $(MFLAGS) -I. $C/aa.c 137 138 138 139 aav.o: $(ROOT)/aav.c 139 140 $(CC) -c $(GFLAGS) -I$(ROOT) $< 140 141 141 142 access.o: access.c 142 143 $(CC) -c $(CFLAGS) $< 143 144 144 145 aliasthis.o: aliasthis.c 146 $(CC) -c $(CFLAGS) $< 147 148 argtypes.o: argtypes.c 145 149 $(CC) -c $(CFLAGS) $< 146 150 147 151 array.o: $(ROOT)/array.c 148 152 $(CC) -c $(GFLAGS) -I$(ROOT) $< 149 153 150 154 arrayop.o: arrayop.c 151 155 $(CC) -c $(CFLAGS) $< 152 156 153 157 async.o: $(ROOT)/async.c 154 158 $(CC) -c $(GFLAGS) -I$(ROOT) $< 155 159 156 160 attrib.o: attrib.c 157 161 $(CC) -c $(CFLAGS) $< 158 162 159 163 bcomplex.o: $C/bcomplex.c 160 164 $(CC) -c $(MFLAGS) $< 161 165 162 166 bit.o: expression.h bit.c 163 167 $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 164 168 trunk/src/lexer.c
r522 r769 2987 2987 { "out", TOKout }, 2988 2988 { "inout", TOKinout }, 2989 2989 { "lazy", TOKlazy }, 2990 2990 { "auto", TOKauto }, 2991 2991 2992 2992 { "align", TOKalign }, 2993 2993 { "extern", TOKextern }, 2994 2994 { "private", TOKprivate }, 2995 2995 { "package", TOKpackage }, 2996 2996 { "protected", TOKprotected }, 2997 2997 { "public", TOKpublic }, 2998 2998 { "export", TOKexport }, 2999 2999 3000 3000 { "body", TOKbody }, 3001 3001 { "invariant", TOKinvariant }, 3002 3002 { "unittest", TOKunittest }, 3003 3003 { "version", TOKversion }, 3004 3004 //{ "manifest", TOKmanifest }, 3005 3005 3006 3006 // Added after 1.0 3007 { "__argTypes", TOKargTypes }, 3007 3008 { "ref", TOKref }, 3008 3009 { "macro", TOKmacro }, 3009 3010 #if DMDV2 3010 3011 { "pure", TOKpure }, 3011 3012 { "nothrow", TOKnothrow }, 3012 3013 { "__thread", TOKtls }, 3013 3014 { "__gshared", TOKgshared }, 3014 3015 { "__traits", TOKtraits }, 3015 3016 { "__overloadset", TOKoverloadset }, 3016 3017 { "__FILE__", TOKfile }, 3017 3018 { "__LINE__", TOKline }, 3018 3019 { "shared", TOKshared }, 3019 3020 { "immutable", TOKimmutable }, 3020 3021 #endif 3021 3022 }; 3022 3023 3023 3024 int Token::isKeyword() 3024 3025 { 3025 3026 for (unsigned u = 0; u < sizeof(keywords) / sizeof(keywords[0]); u++) 3026 3027 { trunk/src/lexer.h
r522 r769 135 135 TOKalign, TOKextern, TOKprivate, TOKprotected, TOKpublic, TOKexport, 136 136 TOKstatic, /*TOKvirtual,*/ TOKfinal, TOKconst, TOKabstract, TOKvolatile, 137 137 TOKdebug, TOKdeprecated, TOKin, TOKout, TOKinout, TOKlazy, 138 138 TOKauto, TOKpackage, TOKmanifest, TOKimmutable, 139 139 140 140 // Statements 141 141 TOKif, TOKelse, TOKwhile, TOKfor, TOKdo, TOKswitch, 142 142 TOKcase, TOKdefault, TOKbreak, TOKcontinue, TOKwith, 143 143 TOKsynchronized, TOKreturn, TOKgoto, TOKtry, TOKcatch, TOKfinally, 144 144 TOKasm, TOKforeach, TOKforeach_reverse, 145 145 TOKscope, 146 146 TOKon_scope_exit, TOKon_scope_failure, TOKon_scope_success, 147 147 148 148 // Contracts 149 149 TOKbody, TOKinvariant, 150 150 151 151 // Testing 152 152 TOKunittest, 153 153 154 154 // Added after 1.0 155 TOKargTypes, 155 156 TOKref, 156 157 TOKmacro, 157 158 #if DMDV2 158 159 TOKtraits, 159 160 TOKoverloadset, 160 161 TOKpure, 161 162 TOKnothrow, 162 163 TOKtls, 163 164 TOKgshared, 164 165 TOKline, 165 166 TOKfile, 166 167 TOKshared, 167 168 TOKat, 168 169 TOKpow, 169 170 TOKpowass, 170 171 #endif 171 172 172 173 TOKMAX 173 174 }; 174 175 trunk/src/linux.mak
r577 r769 25 25 TOTALH= 26 26 27 27 DMD_OBJS = \ 28 28 access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 29 29 cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 30 30 cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 31 31 constfold.o irstate.o dchar.o cond.o debug.o \ 32 32 declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 33 33 dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 34 34 glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 35 35 identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 36 36 lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 37 37 nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 38 38 parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 39 39 stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 40 40 type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 41 41 unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 42 42 hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 43 43 builtin.o clone.o aliasthis.o \ 44 44 man.o arrayop.o port.o response.o async.o json.o speller.o aav.o unittests.o \ 45 imphint.o \45 imphint.o argtypes.o \ 46 46 libelf.o elfobj.o 47 47 48 48 SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 49 49 mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 50 50 identifier.c mtype.c expression.c optimize.c template.h \ 51 51 template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 52 52 aggregate.h parse.c statement.c constfold.c version.h version.c \ 53 53 inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 54 54 attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 55 55 access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 56 56 s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 57 57 scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 58 58 declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 59 59 utf.h utf.c staticassert.h staticassert.c unialpha.c \ 60 60 typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 61 61 doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 62 62 delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 63 63 builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 64 64 aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 65 argtypes.c \ 65 66 $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 66 67 $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 67 68 $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 68 69 $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 69 70 $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 70 71 $C/cgreg.c $C/var.c $C/strtold.c \ 71 72 $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 72 73 $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 73 74 $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 74 75 $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 75 76 $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 76 77 $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 77 78 $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 78 79 $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 79 80 $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 80 81 $C/machobj.c \ 81 82 $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 82 83 $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 83 84 $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 84 85 $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ … … 125 126 $(impcnvtab_output) : impcnvgen 126 127 127 128 impcnvgen : mtype.h impcnvgen.c 128 129 $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 129 130 ./impcnvgen 130 131 131 132 ######### 132 133 133 134 $(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 134 135 135 136 aa.o: $C/aa.h $C/tinfo.h $C/aa.c 136 137 $(CC) -c $(MFLAGS) -I. $C/aa.c 137 138 138 139 aav.o: $(ROOT)/aav.c 139 140 $(CC) -c $(GFLAGS) -I$(ROOT) $< 140 141 141 142 access.o: access.c 142 143 $(CC) -c $(CFLAGS) $< 143 144 144 145 aliasthis.o: aliasthis.c 146 $(CC) -c $(CFLAGS) $< 147 148 argtypes.o: argtypes.c 145 149 $(CC) -c $(CFLAGS) $< 146 150 147 151 array.o: $(ROOT)/array.c 148 152 $(CC) -c $(GFLAGS) -I$(ROOT) $< 149 153 150 154 arrayop.o: arrayop.c 151 155 $(CC) -c $(CFLAGS) $< 152 156 153 157 async.o: $(ROOT)/async.c 154 158 $(CC) -c $(GFLAGS) -I$(ROOT) $< 155 159 156 160 attrib.o: attrib.c 157 161 $(CC) -c $(CFLAGS) $< 158 162 159 163 bcomplex.o: $C/bcomplex.c 160 164 $(CC) -c $(MFLAGS) $< 161 165 162 166 bit.o: expression.h bit.c 163 167 $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 164 168 trunk/src/mtype.c
r767 r769 6106 6106 Identifier *id = (Identifier *)idents.data[i]; 6107 6107 s = s->searchX(loc, sc, id); 6108 6108 } 6109 6109 6110 6110 if (s) 6111 6111 { 6112 6112 t = s->getType(); 6113 6113 if (!t) 6114 6114 { error(loc, "%s is not a type", s->toChars()); 6115 6115 goto Lerr; 6116 6116 } 6117 6117 } 6118 6118 else 6119 6119 { error(loc, "cannot resolve .property for %s", toChars()); 6120 6120 goto Lerr; 6121 6121 } 6122 6122 } 6123 6123 return t; 6124 6124 6125 6125 Lerr: 6126 return t void;6126 return terror; 6127 6127 } 6128 6128 6129 6129 d_uns64 TypeTypeof::size(Loc loc) 6130 6130 { 6131 6131 if (exp->type) 6132 6132 return exp->type->size(loc); 6133 6133 else 6134 6134 return TypeQualified::size(loc); 6135 6135 } 6136 6136 6137 6137 6138 6138 6139 6139 /***************************** TypeReturn *****************************/ 6140 6140 6141 6141 TypeReturn::TypeReturn(Loc loc) 6142 6142 : TypeQualified(Treturn, loc) 6143 6143 { 6144 6144 } 6145 6145 6146 6146 Type *TypeReturn::syntaxCopy() … … 7657 7657 7658 7658 TypeTuple::TypeTuple(Expressions *exps) 7659 7659 : Type(Ttuple) 7660 7660 { 7661 7661 Parameters *arguments = new Parameters; 7662 7662 if (exps) 7663 7663 { 7664 7664 arguments->setDim(exps->dim); 7665 7665 for (size_t i = 0; i < exps->dim; i++) 7666 7666 { Expression *e = (Expression *)exps->data[i]; 7667 7667 if (e->type->ty == Ttuple) 7668 7668 e->error("cannot form tuple of tuples"); 7669 7669 Parameter *arg = new Parameter(STCundefined, e->type, NULL, NULL); 7670 7670 arguments->data[i] = (void *)arg; 7671 7671 } 7672 7672 } 7673 7673 this->arguments = arguments; 7674 7674 //printf("TypeTuple() %p, %s\n", this, toChars()); 7675 7675 } 7676 7676 7677 /******************************************* 7678 * Type tuple with 0, 1 or 2 types in it. 7679 */ 7680 TypeTuple::TypeTuple() 7681 : Type(Ttuple) 7682 { 7683 arguments = new Parameters(); 7684 } 7685 7686 TypeTuple::TypeTuple(Type *t1) 7687 : Type(Ttuple) 7688 { 7689 arguments = new Parameters(); 7690 arguments->push(new Parameter(0, t1, NULL, NULL)); 7691 } 7692 7693 TypeTuple::TypeTuple(Type *t1, Type *t2) 7694 : Type(Ttuple) 7695 { 7696 arguments = new Parameters(); 7697 arguments->push(new Parameter(0, t1, NULL, NULL)); 7698 arguments->push(new Parameter(0, t2, NULL, NULL)); 7699 } 7700 7677 7701 Type *TypeTuple::syntaxCopy() 7678 7702 { 7679 7703 Parameters *args = Parameter::arraySyntaxCopy(arguments); 7680 7704 Type *t = new TypeTuple(args); 7681 7705 t->mod = mod; 7682 7706 return t; 7683 7707 } 7684 7708 7685 7709 Type *TypeTuple::semantic(Loc loc, Scope *sc) 7686 7710 { 7687 7711 //printf("TypeTuple::semantic(this = %p)\n", this); 7688 7712 //printf("TypeTuple::semantic() %p, %s\n", this, toChars()); 7689 7713 if (!deco) 7690 7714 deco = merge()->deco; 7691 7715 7692 7716 /* Don't return merge(), because a tuple with one type has the 7693 7717 * same deco as that type. 7694 7718 */ 7695 7719 return this; 7696 7720 } trunk/src/mtype.h
r768 r769 31 31 struct TypedefDeclaration; 32 32 struct TypeInfoDeclaration; 33 33 struct Dsymbol; 34 34 struct TemplateInstance; 35 35 struct CppMangleState; 36 36 struct TemplateDeclaration; 37 37 enum LINK; 38 38 39 39 struct TypeBasic; 40 40 struct HdrGenState; 41 41 struct Parameter; 42 42 43 43 // Back end 44 44 #if IN_GCC 45 45 union tree_node; typedef union tree_node TYPE; 46 46 typedef TYPE type; 47 47 #else 48 48 typedef struct TYPE type; 49 49 #endif 50 50 struct Symbol; 51 struct TypeTuple; 51 52 52 53 enum ENUMTY 53 54 { 54 55 Tarray, // slice array, aka T[] 55 56 Tsarray, // static array, aka T[dimension] 56 57 Tnarray, // resizable array, aka T[new] 57 58 Taarray, // associative array, aka T[type] 58 59 Tpointer, 59 60 Treference, 60 61 Tfunction, 61 62 Tident, 62 63 Tclass, 63 64 Tstruct, 64 65 65 66 Tenum, 66 67 Ttypedef, 67 68 Tdelegate, 68 69 Tnone, 69 70 Tvoid, 70 71 Tint8, … … 292 293 virtual Expression *getProperty(Loc loc, Identifier *ident); 293 294 virtual Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 294 295 Expression *noMember(Scope *sc, Expression *e, Identifier *ident); 295 296 virtual unsigned memalign(unsigned salign); 296 297 virtual Expression *defaultInit(Loc loc = 0); 297 298 virtual Expression *defaultInitLiteral(Loc loc = 0); 298 299 virtual int isZeroInit(Loc loc = 0); // if initializer is 0 299 300 virtual dt_t **toDt(dt_t **pdt); 300 301 Identifier *getTypeInfoIdent(int internal); 301 302 virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 302 303 virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 303 304 Expression *getInternalTypeInfo(Scope *sc); 304 305 Expression *getTypeInfo(Scope *sc); 305 306 virtual TypeInfoDeclaration *getTypeInfoDeclaration(); 306 307 virtual int builtinTypeInfo(); 307 308 virtual Type *reliesOnTident(); 308 309 virtual int hasWild(); 309 310 virtual unsigned wildMatch(Type *targ); 310 311 virtual Expression *toExpression(); 311 312 virtual int hasPointers(); 313 virtual TypeTuple *toArgTypes(); 312 314 virtual Type *nextOf(); 313 315 uinteger_t sizemask(); 314 316 315 317 static void error(Loc loc, const char *format, ...); 316 318 static void warning(Loc loc, const char *format, ...); 317 319 318 320 // For backend 319 321 virtual unsigned totym(); 320 322 virtual type *toCtype(); 321 323 virtual type *toCParamtype(); 322 324 virtual Symbol *toSymbol(); 323 325 324 326 // For eliminating dynamic_cast 325 327 virtual TypeBasic *isTypeBasic(); 326 328 }; 327 329 328 330 struct TypeError : Type 329 331 { 330 332 TypeError(); 331 333 … … 371 373 unsigned alignsize(); 372 374 Expression *getProperty(Loc loc, Identifier *ident); 373 375 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 374 376 char *toChars(); 375 377 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 376 378 #if CPP_MANGLE 377 379 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 378 380 #endif 379 381 int isintegral(); 380 382 int isbit(); 381 383 int isfloating(); 382 384 int isreal(); 383 385 int isimaginary(); 384 386 int iscomplex(); 385 387 int isscalar(); 386 388 int isunsigned(); 387 389 MATCH implicitConvTo(Type *to); 388 390 Expression *defaultInit(Loc loc); 389 391 int isZeroInit(Loc loc); 390 392 int builtinTypeInfo(); 393 TypeTuple *toArgTypes(); 391 394 392 395 // For eliminating dynamic_cast 393 396 TypeBasic *isTypeBasic(); 394 397 }; 395 398 396 399 struct TypeArray : TypeNext 397 400 { 398 401 TypeArray(TY ty, Type *next); 399 402 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 400 403 }; 401 404 402 405 // Static array, one with a fixed dimension 403 406 struct TypeSArray : TypeArray 404 407 { 405 408 Expression *dim; 406 409 407 410 TypeSArray(Type *t, Expression *dim); 408 411 Type *syntaxCopy(); 409 412 d_uns64 size(Loc loc); 410 413 unsigned alignsize(); 411 414 Type *semantic(Loc loc, Scope *sc); 412 415 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 413 416 void toDecoBuffer(OutBuffer *buf, int flag); 414 417 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 415 418 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 416 419 int isString(); 417 420 int isZeroInit(Loc loc); 418 421 unsigned memalign(unsigned salign); 419 422 MATCH constConv(Type *to); 420 423 MATCH implicitConvTo(Type *to); 421 424 Expression *defaultInit(Loc loc); 422 425 Expression *defaultInitLiteral(Loc loc); 423 426 dt_t **toDt(dt_t **pdt); 424 427 dt_t **toDtElem(dt_t **pdt, Expression *e); 425 428 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 426 429 TypeInfoDeclaration *getTypeInfoDeclaration(); 427 430 Expression *toExpression(); 428 431 int hasPointers(); 432 TypeTuple *toArgTypes(); 429 433 #if CPP_MANGLE 430 434 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 431 435 #endif 432 436 433 437 type *toCtype(); 434 438 type *toCParamtype(); 435 439 }; 436 440 437 441 // Dynamic array, no dimension 438 442 struct TypeDArray : TypeArray 439 443 { 440 444 TypeDArray(Type *t); 441 445 Type *syntaxCopy(); 442 446 d_uns64 size(Loc loc); 443 447 unsigned alignsize(); 444 448 Type *semantic(Loc loc, Scope *sc); 445 449 void toDecoBuffer(OutBuffer *buf, int flag); 446 450 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 447 451 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 448 452 int isString(); 449 453 int isZeroInit(Loc loc); 450 454 int checkBoolean(); 451 455 MATCH implicitConvTo(Type *to); 452 456 Expression *defaultInit(Loc loc); 453 457 int builtinTypeInfo(); 454 458 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 455 459 TypeInfoDeclaration *getTypeInfoDeclaration(); 456 460 int hasPointers(); 461 TypeTuple *toArgTypes(); 457 462 #if CPP_MANGLE 458 463 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 459 464 #endif 460 465 461 466 type *toCtype(); 462 467 }; 463 468 464 469 struct TypeAArray : TypeArray 465 470 { 466 471 Type *index; // key type 467 472 Loc loc; 468 473 Scope *sc; 469 474 470 475 StructDeclaration *impl; // implementation 471 476 472 477 TypeAArray(Type *t, Type *index); 473 478 Type *syntaxCopy(); 474 479 d_uns64 size(Loc loc); 475 480 Type *semantic(Loc loc, Scope *sc); 476 481 StructDeclaration *getImpl(); 477 482 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 478 483 void toDecoBuffer(OutBuffer *buf, int flag); 479 484 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 480 485 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 481 486 Expression *defaultInit(Loc loc); 482 487 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 483 488 int isZeroInit(Loc loc); 484 489 int checkBoolean(); 485 490 TypeInfoDeclaration *getTypeInfoDeclaration(); 486 491 int hasPointers(); 492 TypeTuple *toArgTypes(); 487 493 MATCH implicitConvTo(Type *to); 488 494 MATCH constConv(Type *to); 489 495 #if CPP_MANGLE 490 496 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 491 497 #endif 492 498 493 499 // Back end 494 500 Symbol *aaGetSymbol(const char *func, int flags); 495 501 496 502 type *toCtype(); 497 503 }; 498 504 499 505 struct TypePointer : TypeNext 500 506 { 501 507 TypePointer(Type *t); 502 508 Type *syntaxCopy(); 503 509 Type *semantic(Loc loc, Scope *sc); 504 510 d_uns64 size(Loc loc); 505 511 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 506 512 MATCH implicitConvTo(Type *to); 507 513 int isscalar(); 508 514 Expression *defaultInit(Loc loc); 509 515 int isZeroInit(Loc loc); 510 516 TypeInfoDeclaration *getTypeInfoDeclaration(); 511 517 int hasPointers(); 518 TypeTuple *toArgTypes(); 512 519 #if CPP_MANGLE 513 520 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 514 521 #endif 515 522 516 523 type *toCtype(); 517 524 }; 518 525 519 526 struct TypeReference : TypeNext 520 527 { 521 528 TypeReference(Type *t); 522 529 Type *syntaxCopy(); 523 530 Type *semantic(Loc loc, Scope *sc); 524 531 d_uns64 size(Loc loc); 525 532 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 526 533 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 527 534 Expression *defaultInit(Loc loc); 528 535 int isZeroInit(Loc loc); 529 536 #if CPP_MANGLE 530 537 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 531 538 #endif … … 594 601 unsigned totym(); 595 602 }; 596 603 597 604 struct TypeDelegate : TypeNext 598 605 { 599 606 // .next is a TypeFunction 600 607 601 608 TypeDelegate(Type *t); 602 609 Type *syntaxCopy(); 603 610 Type *semantic(Loc loc, Scope *sc); 604 611 d_uns64 size(Loc loc); 605 612 unsigned alignsize(); 606 613 MATCH implicitConvTo(Type *to); 607 614 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 608 615 Expression *defaultInit(Loc loc); 609 616 int isZeroInit(Loc loc); 610 617 int checkBoolean(); 611 618 TypeInfoDeclaration *getTypeInfoDeclaration(); 612 619 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 613 620 int hasPointers(); 621 TypeTuple *toArgTypes(); 614 622 #if CPP_MANGLE 615 623 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 616 624 #endif 617 625 618 626 type *toCtype(); 619 627 }; 620 628 621 629 struct TypeQualified : Type 622 630 { 623 631 Loc loc; 624 632 Array idents; // array of Identifier's representing ident.ident.ident etc. 625 633 626 634 TypeQualified(TY ty, Loc loc); 627 635 void syntaxCopyHelper(TypeQualified *t); 628 636 void addIdent(Identifier *ident); 629 637 void toCBuffer2Helper(OutBuffer *buf, HdrGenState *hgs); 630 638 d_uns64 size(Loc loc); 631 639 void resolveHelper(Loc loc, Scope *sc, Dsymbol *s, Dsymbol *scopesym, 632 640 Expression **pe, Type **pt, Dsymbol **ps); 633 641 }; … … 694 702 TypeStruct(StructDeclaration *sym); 695 703 d_uns64 size(Loc loc); 696 704 unsigned alignsize(); 697 705 char *toChars(); 698 706 Type *syntaxCopy(); 699 707 Type *semantic(Loc loc, Scope *sc); 700 708 Dsymbol *toDsymbol(Scope *sc); 701 709 void toDecoBuffer(OutBuffer *buf, int flag); 702 710 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 703 711 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 704 712 unsigned memalign(unsigned salign); 705 713 Expression *defaultInit(Loc loc); 706 714 Expression *defaultInitLiteral(Loc loc); 707 715 int isZeroInit(Loc loc); 708 716 int isAssignable(); 709 717 int checkBoolean(); 710 718 dt_t **toDt(dt_t **pdt); 711 719 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 712 720 TypeInfoDeclaration *getTypeInfoDeclaration(); 713 721 int hasPointers(); 722 TypeTuple *toArgTypes(); 714 723 MATCH implicitConvTo(Type *to); 715 724 MATCH constConv(Type *to); 716 725 Type *toHeadMutable(); 717 726 #if CPP_MANGLE 718 727 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 719 728 #endif 720 729 721 730 type *toCtype(); 722 731 }; 723 732 724 733 struct TypeEnum : Type 725 734 { 726 735 EnumDeclaration *sym; 727 736 728 737 TypeEnum(EnumDeclaration *sym); 729 738 Type *syntaxCopy(); 730 739 d_uns64 size(Loc loc); 731 740 unsigned alignsize(); 732 741 char *toChars(); 733 742 Type *semantic(Loc loc, Scope *sc); … … 736 745 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 737 746 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 738 747 Expression *getProperty(Loc loc, Identifier *ident); 739 748 int isintegral(); 740 749 int isfloating(); 741 750 int isreal(); 742 751 int isimaginary(); 743 752 int iscomplex(); 744 753 int isscalar(); 745 754 int isunsigned(); 746 755 int checkBoolean(); 747 756 int isAssignable(); 748 757 MATCH implicitConvTo(Type *to); 749 758 MATCH constConv(Type *to); 750 759 Type *toBasetype(); 751 760 Expression *defaultInit(Loc loc); 752 761 int isZeroInit(Loc loc); 753 762 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 754 763 TypeInfoDeclaration *getTypeInfoDeclaration(); 755 764 int hasPointers(); 765 TypeTuple *toArgTypes(); 756 766 #if CPP_MANGLE 757 767 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 758 768 #endif 759 769 760 770 type *toCtype(); 761 771 }; 762 772 763 773 struct TypeTypedef : Type 764 774 { 765 775 TypedefDeclaration *sym; 766 776 767 777 TypeTypedef(TypedefDeclaration *sym); 768 778 Type *syntaxCopy(); 769 779 d_uns64 size(Loc loc); 770 780 unsigned alignsize(); 771 781 char *toChars(); 772 782 Type *semantic(Loc loc, Scope *sc); 773 783 Dsymbol *toDsymbol(Scope *sc); 774 784 void toDecoBuffer(OutBuffer *buf, int flag); 775 785 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); … … 778 788 int isbit(); 779 789 int isintegral(); 780 790 int isfloating(); 781 791 int isreal(); 782 792 int isimaginary(); 783 793 int iscomplex(); 784 794 int isscalar(); 785 795 int isunsigned(); 786 796 int checkBoolean(); 787 797 int isAssignable(); 788 798 Type *toBasetype(); 789 799 MATCH implicitConvTo(Type *to); 790 800 MATCH constConv(Type *to); 791 801 Expression *defaultInit(Loc loc); 792 802 Expression *defaultInitLiteral(Loc loc); 793 803 int isZeroInit(Loc loc); 794 804 dt_t **toDt(dt_t **pdt); 795 805 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 796 806 TypeInfoDeclaration *getTypeInfoDeclaration(); 797 807 int hasPointers(); 808 TypeTuple *toArgTypes(); 798 809 int hasWild(); 799 810 Type *toHeadMutable(); 800 811 #if CPP_MANGLE 801 812 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 802 813 #endif 803 814 804 815 type *toCtype(); 805 816 type *toCParamtype(); 806 817 }; 807 818 808 819 struct TypeClass : Type 809 820 { 810 821 ClassDeclaration *sym; 811 822 812 823 TypeClass(ClassDeclaration *sym); 813 824 d_uns64 size(Loc loc); 814 825 char *toChars(); 815 826 Type *syntaxCopy(); 816 827 Type *semantic(Loc loc, Scope *sc); 817 828 Dsymbol *toDsymbol(Scope *sc); 818 829 void toDecoBuffer(OutBuffer *buf, int flag); 819 830 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 820 831 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 821 832 ClassDeclaration *isClassHandle(); 822 833 int isBaseOf(Type *t, int *poffset); 823 834 MATCH implicitConvTo(Type *to); 824 835 Expression *defaultInit(Loc loc); 825 836 int isZeroInit(Loc loc); 826 837 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 827 838 int isscope(); 828 839 int checkBoolean(); 829 840 TypeInfoDeclaration *getTypeInfoDeclaration(); 830 841 int hasPointers(); 842 TypeTuple *toArgTypes(); 831 843 int builtinTypeInfo(); 832 844 #if DMDV2 833 845 Type *toHeadMutable(); 834 846 MATCH constConv(Type *to); 835 847 #if CPP_MANGLE 836 848 void toCppMangle(OutBuffer *buf, CppMangleState *cms); 837 849 #endif 838 850 #endif 839 851 840 852 type *toCtype(); 841 853 842 854 Symbol *toSymbol(); 843 855 }; 844 856 845 857 struct TypeTuple : Type 846 858 { 847 859 Parameters *arguments; // types making up the tuple 848 860 849 861 TypeTuple(Parameters *arguments); 850 862 TypeTuple(Expressions *exps); 863 TypeTuple(); 864 TypeTuple(Type *t1); 865 TypeTuple(Type *t1, Type *t2); 851 866 Type *syntaxCopy(); 852 867 Type *semantic(Loc loc, Scope *sc); 853 868 int equals(Object *o); 854 869 Type *reliesOnTident(); 855 870 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 856 871 void toDecoBuffer(OutBuffer *buf, int flag); 857 872 Expression *getProperty(Loc loc, Identifier *ident); 858 873 TypeInfoDeclaration *getTypeInfoDeclaration(); 859 874 }; 860 875 861 876 struct TypeSlice : TypeNext 862 877 { 863 878 Expression *lwr; 864 879 Expression *upr; 865 880 866 881 TypeSlice(Type *next, Expression *lwr, Expression *upr); 867 882 Type *syntaxCopy(); 868 883 Type *semantic(Loc loc, Scope *sc); 869 884 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 870 885 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); trunk/src/osx.mak
r577 r769 31 31 TOTALH= 32 32 33 33 DMD_OBJS = \ 34 34 access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 35 35 cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 36 36 cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 37 37 constfold.o irstate.o dchar.o cond.o debug.o \ 38 38 declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 39 39 dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 40 40 glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 41 41 identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 42 42 lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 43 43 nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 44 44 parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 45 45 stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 46 46 type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 47 47 unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 48 48 hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 49 49 builtin.o clone.o aliasthis.o \ 50 50 man.o arrayop.o port.o response.o async.o json.o speller.o aav.o unittests.o \ 51 imphint.o \51 imphint.o argtypes.o \ 52 52 libmach.o machobj.o 53 53 54 54 SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 55 55 mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 56 56 identifier.c mtype.c expression.c optimize.c template.h \ 57 57 template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 58 58 aggregate.h parse.c statement.c constfold.c version.h version.c \ 59 59 inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 60 60 attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 61 61 access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 62 s2ir.c todt.c e2ir.c util.c identifier.h parse.h objfile.h\62 s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 63 63 scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 64 64 declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 65 65 utf.h utf.c staticassert.h staticassert.c unialpha.c \ 66 66 typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 67 67 doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 68 68 delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 69 69 builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 70 70 aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 71 argtypes.c \ 71 72 $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 72 73 $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 73 74 $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 74 75 $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 75 76 $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 76 77 $C/cgreg.c $C/var.c $C/strtold.c \ 77 78 $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 78 79 $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 79 80 $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 80 81 $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 81 82 $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 82 83 $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 83 84 $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 84 85 $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 85 86 $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 86 87 $C/machobj.c \ 87 88 $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 88 89 $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 89 90 $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 90 91 $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ … … 131 132 $(impcnvtab_output) : impcnvgen 132 133 133 134 impcnvgen : mtype.h impcnvgen.c 134 135 ${ENVP} $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 135 136 ./impcnvgen 136 137 137 138 ######### 138 139 139 140 $(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 140 141 141 142 aa.o: $C/aa.h $C/tinfo.h $C/aa.c 142 143 $(CC) -c $(MFLAGS) -I. $C/aa.c 143 144 144 145 aav.o: $(ROOT)/aav.c 145 146 $(CC) -c $(GFLAGS) -I$(ROOT) $< 146 147 147 148 access.o: access.c 148 149 $(CC) -c $(CFLAGS) $< 149 150 150 151 aliasthis.o: aliasthis.c 152 $(CC) -c $(CFLAGS) $< 153 154 argtypes.o: argtypes.c 151 155 $(CC) -c $(CFLAGS) $< 152 156 153 157 array.o: $(ROOT)/array.c 154 158 $(CC) -c $(GFLAGS) -I$(ROOT) $< 155 159 156 160 arrayop.o: arrayop.c 157 161 $(CC) -c $(CFLAGS) $< 158 162 159 163 async.o: $(ROOT)/async.c 160 164 $(CC) -c $(GFLAGS) -I$(ROOT) $< 161 165 162 166 attrib.o: attrib.c 163 167 $(CC) -c $(CFLAGS) $< 164 168 165 169 bcomplex.o: $C/bcomplex.c 166 170 $(CC) -c $(MFLAGS) $C/bcomplex.c 167 171 168 172 bit.o: expression.h bit.c 169 173 $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 170 174 trunk/src/parse.c
r707 r769 5155 5155 TemplateParameters *tpl = NULL; 5156 5156 Loc loc = this->loc; 5157 5157 5158 5158 nextToken(); 5159 5159 if (token.value == TOKlparen) 5160 5160 { 5161 5161 nextToken(); 5162 5162 targ = parseType(&ident); 5163 5163 if (token.value == TOKcolon || token.value == TOKequal) 5164 5164 { 5165 5165 tok = token.value; 5166 5166 nextToken(); 5167 5167 if (tok == TOKequal && 5168 5168 (token.value == TOKtypedef || 5169 5169 token.value == TOKstruct || 5170 5170 token.value == TOKunion || 5171 5171 token.value == TOKclass || 5172 5172 token.value == TOKsuper || 5173 5173 token.value == TOKenum || 5174 5174 token.value == TOKinterface || 5175 token.value == TOKargTypes || 5175 5176 #if DMDV2 5176 5177 token.value == TOKconst && peek(&token)->value == TOKrparen || 5177 5178 token.value == TOKinvariant && peek(&token)->value == TOKrparen || 5178 5179 token.value == TOKimmutable && peek(&token)->value == TOKrparen || 5179 5180 token.value == TOKshared && peek(&token)->value == TOKrparen || 5180 5181 token.value == TOKwild && peek(&token)->value == TOKrparen || 5181 5182 #endif 5182 5183 token.value == TOKfunction || 5183 5184 token.value == TOKdelegate || 5184 5185 token.value == TOKreturn)) 5185 5186 { 5186 5187 tok2 = token.value; 5187 5188 nextToken(); 5188 5189 } 5189 5190 else 5190 5191 { 5191 5192 tspec = parseType(); 5192 5193 } 5193 5194 } 5194 5195 if (ident && tspec) trunk/src/solaris.mak
r599 r769 25 25 TOTALH= 26 26 27 27 DMD_OBJS = \ 28 28 access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 29 29 cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 30 30 cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 31 31 constfold.o irstate.o dchar.o cond.o debug.o \ 32 32 declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 33 33 dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 34 34 glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 35 35 identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 36 36 lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 37 37 nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 38 38 parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 39 39 stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 40 40 type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 41 41 unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 42 42 hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 43 43 builtin.o clone.o aliasthis.o \ 44 44 man.o arrayop.o port.o response.o async.o json.o speller.o aav.o unittests.o \ 45 imphint.o \45 imphint.o argtypes.o \ 46 46 libelf.o elfobj.o 47 47 48 48 SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 49 49 mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 50 50 identifier.c mtype.c expression.c optimize.c template.h \ 51 51 template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 52 52 aggregate.h parse.c statement.c constfold.c version.h version.c \ 53 53 inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 54 54 attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 55 55 access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 56 56 s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 57 57 scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 58 58 declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 59 59 utf.h utf.c staticassert.h staticassert.c unialpha.c \ 60 60 typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 61 61 doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 62 62 delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 63 63 builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 64 64 aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 65 argtypes.c \ 65 66 $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 66 67 $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 67 68 $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 68 69 $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 69 70 $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 70 71 $C/cgreg.c $C/var.c $C/strtold.c \ 71 72 $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 72 73 $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 73 74 $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 74 75 $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 75 76 $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 76 77 $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 77 78 $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 78 79 $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 79 80 $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 80 81 $C/machobj.c \ 81 82 $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 82 83 $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 83 84 $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 84 85 $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ … … 125 126 $(impcnvtab_output) : impcnvgen 126 127 127 128 impcnvgen : mtype.h impcnvgen.c 128 129 $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 129 130 ./impcnvgen 130 131 131 132 ######### 132 133 133 134 $(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 134 135 135 136 aa.o: $C/aa.h $C/tinfo.h $C/aa.c 136 137 $(CC) -c $(MFLAGS) -I. $C/aa.c 137 138 138 139 aav.o: $(ROOT)/aav.c 139 140 $(CC) -c $(GFLAGS) -I$(ROOT) $< 140 141 141 142 access.o: access.c 142 143 $(CC) -c $(CFLAGS) $< 143 144 144 145 aliasthis.o: aliasthis.c 146 $(CC) -c $(CFLAGS) $< 147 148 argtypes.o: argtypes.c 145 149 $(CC) -c $(CFLAGS) $< 146 150 147 151 array.o: $(ROOT)/array.c 148 152 $(CC) -c $(GFLAGS) -I$(ROOT) $< 149 153 150 154 arrayop.o: arrayop.c 151 155 $(CC) -c $(CFLAGS) $< 152 156 153 157 async.o: $(ROOT)/async.c 154 158 $(CC) -c $(GFLAGS) -I$(ROOT) $< 155 159 156 160 attrib.o: attrib.c 157 161 $(CC) -c $(CFLAGS) $< 158 162 159 163 bcomplex.o: $C/bcomplex.c 160 164 $(CC) -c $(MFLAGS) $< 161 165 162 166 bit.o: expression.h bit.c 163 167 $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 164 168 trunk/src/typinf.c
r750 r769 606 606 // xdtor 607 607 FuncDeclaration *sdtor = sd->dtor; 608 608 if (sdtor) 609 609 dtxoff(pdt, sdtor->toSymbol(), 0, TYnptr); 610 610 else 611 611 dtsize_t(pdt, 0); // xdtor 612 612 613 613 // xpostblit 614 614 FuncDeclaration *spostblit = sd->postblit; 615 615 if (spostblit) 616 616 dtxoff(pdt, spostblit->toSymbol(), 0, TYnptr); 617 617 else 618 618 dtsize_t(pdt, 0); // xpostblit 619 619 #endif 620 620 621 621 // uint m_align; 622 622 dtsize_t(pdt, tc->alignsize()); 623 623 624 624 if (global.params.isX86_64) 625 625 { 626 dtsize_t(pdt, 0); // m_arg1 627 dtsize_t(pdt, 0); // m_arg2 626 TypeTuple *tup = tc->toArgTypes(); 627 assert(tup->arguments->dim <= 2); 628 for (int i = 0; i < 2; i++) 629 { 630 if (i < tup->arguments->dim) 631 { 632 Type *targ = ((Parameter *)tup->arguments->data[i])->type; 633 targ = targ->merge(); 634 targ->getTypeInfo(NULL); 635 dtxoff(pdt, targ->vtinfo->toSymbol(), 0, TYnptr); // m_argi 636 } 637 else 638 dtsize_t(pdt, 0); // m_argi 639 } 628 640 } 629 641 630 642 // name[] 631 643 dtnbytes(pdt, namelen + 1, name); 632 644 } 633 645 634 646 void TypeInfoClassDeclaration::toDt(dt_t **pdt) 635 647 { 636 648 //printf("TypeInfoClassDeclaration::toDt() %s\n", tinfo->toChars()); 637 649 #if DMDV1 638 650 dtxoff(pdt, Type::typeinfoclass->toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoClass 639 651 dtsize_t(pdt, 0); // monitor 640 652 641 653 assert(tinfo->ty == Tclass); 642 654 643 655 TypeClass *tc = (TypeClass *)tinfo; 644 656 Symbol *s; 645 657 646 658 if (!tc->sym->vclassinfo) 647 659 tc->sym->vclassinfo = new ClassInfoDeclaration(tc->sym); trunk/src/win32.mak
r613 r769 64 64 65 65 debdmd: 66 66 $(MAKE) OPT= "DEBUG=-D -g -DUNITTEST" LFLAGS=-L/ma/co dmd.exe 67 67 68 68 ######################################### 69 69 70 70 # D front end 71 71 72 72 OBJ1= mars.obj enum.obj struct.obj dsymbol.obj import.obj id.obj \ 73 73 staticassert.obj identifier.obj mtype.obj expression.obj \ 74 74 optimize.obj template.obj lexer.obj declaration.obj cast.obj \ 75 75 init.obj func.obj utf.obj unialpha.obj parse.obj statement.obj \ 76 76 constfold.obj version.obj inifile.obj typinf.obj \ 77 77 module.obj scope.obj dump.obj cond.obj inline.obj opover.obj \ 78 78 entity.obj class.obj mangle.obj attrib.obj impcnvtab.obj \ 79 79 link.obj access.obj doc.obj macro.obj hdrgen.obj delegatize.obj \ 80 80 interpret.obj traits.obj aliasthis.obj \ 81 81 builtin.obj clone.obj libomf.obj arrayop.obj irstate.obj \ 82 82 glue.obj msc.obj ph.obj tk.obj s2ir.obj todt.obj e2ir.obj tocsym.obj \ 83 83 util.obj bit.obj eh.obj toobj.obj toctype.obj tocvdebug.obj toir.obj \ 84 json.obj unittests.obj imphint.obj 84 json.obj unittests.obj imphint.obj argtypes.obj 85 85 86 86 # from C/C++ compiler optimizer and back end 87 87 88 88 OBJ8= go.obj gdag.obj gother.obj gflow.obj gloop.obj var.obj el.obj \ 89 89 newman.obj glocal.obj os.obj nteh.obj evalu8.obj cgcs.obj \ 90 90 rtlsym.obj html.obj cgelem.obj cgen.obj cgreg.obj out.obj \ 91 91 blockopt.obj cgobj.obj cg.obj cgcv.obj type.obj dt.obj \ 92 92 debug.obj code.obj cg87.obj cgsched.obj ee.obj csymbol.obj \ 93 93 cgcod.obj cod1.obj cod2.obj cod3.obj cod4.obj cod5.obj outbuf.obj \ 94 94 bcomplex.obj iasm.obj ptrntab.obj aa.obj ti_achar.obj md5.obj 95 95 96 96 # from ROOT 97 97 98 98 ROOTOBJS= lstring.obj array.obj gnuc.obj man.obj rmem.obj port.obj root.obj \ 99 99 stringtable.obj dchar.obj response.obj async.obj speller.obj aav.obj 100 100 101 101 OBJS= $(OBJ1) $(OBJ8) $(ROOTOBJS) 102 102 103 103 SRCS= mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c utf.h \ 104 104 utf.c entity.c identifier.c mtype.c expression.c optimize.c \ 105 105 template.h template.c lexer.c declaration.c cast.c \ 106 106 cond.h cond.c link.c aggregate.h staticassert.h parse.c statement.c \ 107 107 constfold.c version.h version.c inifile.c iasm.c staticassert.c \ 108 108 module.c scope.c dump.c init.h init.c attrib.h attrib.c opover.c \ 109 109 eh.c toctype.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 110 110 access.c complex_t.h unialpha.c irstate.h irstate.c glue.c msc.c \ 111 111 ph.c tk.c s2ir.c todt.c e2ir.c util.c toobj.c cppmangle.c \ 112 identifier.h parse.h objfile.hscope.h enum.h import.h \112 identifier.h parse.h scope.h enum.h import.h \ 113 113 typinf.c tocvdebug.c toelfdebug.c mars.h module.h mtype.h dsymbol.h \ 114 114 declaration.h lexer.h expression.h statement.h doc.h doc.c \ 115 115 macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 116 116 delegatize.c toir.h toir.c interpret.c traits.c builtin.c \ 117 117 clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 118 aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c 118 aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c argtypes.c 119 119 120 120 # From C++ compiler 121 121 122 122 BACKSRC= $C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c \ 123 123 $C\global.h $C\parser.h $C\code.h $C\type.h $C\dt.h $C\cgcv.h \ 124 124 $C\el.h $C\iasm.h $C\rtlsym.h $C\html.h \ 125 125 $C\bcomplex.c $C\blockopt.c $C\cg.c $C\cg87.c \ 126 126 $C\cgcod.c $C\cgcs.c $C\cgcv.c $C\cgelem.c $C\cgen.c $C\cgobj.c \ 127 127 $C\cgreg.c $C\var.c \ 128 128 $C\cgsched.c $C\cod1.c $C\cod2.c $C\cod3.c $C\cod4.c $C\cod5.c \ 129 129 $C\code.c $C\symbol.c $C\debug.c $C\dt.c $C\ee.c $C\el.c \ 130 130 $C\evalu8.c $C\go.c $C\gflow.c $C\gdag.c \ 131 131 $C\gother.c $C\glocal.c $C\gloop.c $C\html.c $C\newman.c \ 132 132 $C\nteh.c $C\os.c $C\out.c $C\outbuf.c $C\ptrntab.c $C\rtlsym.c \ 133 133 $C\type.c $C\melf.h $C\mach.h $C\bcomplex.h \ 134 134 $C\cdeflnx.h $C\outbuf.h $C\token.h $C\tassert.h \ 135 135 $C\elfobj.c $C\cv4.h $C\dwarf2.h $C\cpp.h $C\exh.h $C\go.h \ 136 136 $C\dwarf.c $C\dwarf.h $C\cppman.c $C\machobj.c \ 137 137 $C\strtold.c $C\aa.h $C\aa.c $C\tinfo.h $C\ti_achar.c \ 138 138 $C\md5.h $C\md5.c \ … … 426 426 port.obj : $(ROOT)\port.c 427 427 $(CC) -c $(CFLAGS) $(ROOT)\port.c 428 428 429 429 root.obj : $(ROOT)\root.c 430 430 $(CC) -c $(CFLAGS) $(ROOT)\root.c 431 431 432 432 response.obj : $(ROOT)\response.c 433 433 $(CC) -c $(CFLAGS) $(ROOT)\response.c 434 434 435 435 speller.obj : $(ROOT)\speller.h $(ROOT)\speller.c 436 436 $(CC) -c $(CFLAGS) $(ROOT)\speller.c 437 437 438 438 stringtable.obj : $(ROOT)\stringtable.c 439 439 $(CC) -c $(CFLAGS) $(ROOT)\stringtable.c 440 440 441 441 442 442 ################# Source file dependencies ############### 443 443 444 444 access.obj : $(TOTALH) enum.h aggregate.h init.h attrib.h access.c 445 445 aliasthis.obj : $(TOTALH) aliasthis.h aliasthis.c 446 argtypes.obj : $(TOTALH) mtype.h argtypes.c 446 447 arrayop.obj : $(TOTALH) identifier.h declaration.h arrayop.c 447 448 attrib.obj : $(TOTALH) identifier.h declaration.h attrib.h attrib.c 448 449 builtin.obj : $(TOTALH) builtin.c 449 450 cast.obj : $(TOTALH) expression.h mtype.h cast.c 450 451 class.obj : $(TOTALH) enum.h class.c 451 452 clone.obj : $(TOTALH) clone.c 452 453 constfold.obj : $(TOTALH) expression.h constfold.c 453 454 cond.obj : $(TOTALH) identifier.h declaration.h cond.h cond.c 454 455 declaration.obj : $(TOTALH) identifier.h attrib.h declaration.h declaration.c 455 456 delegatize.obj : $(TOTALH) delegatize.c 456 457 doc.obj : $(TOTALH) doc.h doc.c 457 458 enum.obj : $(TOTALH) identifier.h enum.h enum.c 458 459 expression.obj : $(TOTALH) expression.h expression.c 459 460 func.obj : $(TOTALH) identifier.h attrib.h declaration.h func.c 460 461 hdrgen.obj : $(TOTALH) hdrgen.h hdrgen.c 461 462 id.obj : $(TOTALH) id.h id.c 462 463 identifier.obj : $(TOTALH) identifier.h identifier.c 463 464 import.obj : $(TOTALH) dsymbol.h import.h import.c 464 465 inifile.obj : $(TOTALH) inifile.c 465 466 init.obj : $(TOTALH) init.h init.c
