Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 769

Show
Ignore:
Timestamp:
11/29/10 02:00:46 (14 years ago)
Author:
walter
Message:

belatedly merge in changes from changeset 717

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/backend/cgen.c

    r738 r769  
    88 * only. The license is in /dmd/src/dmd/backendlicense.txt 
    99 * or /dm/src/dmd/backendlicense.txt 
    1010 * For any other uses, please contact Digital Mars. 
    1111 */ 
    1212 
    1313#if !SPP 
    1414 
    1515#include        <stdio.h> 
    1616#include        <string.h> 
    1717#include        <time.h> 
    1818#include        "cc.h" 
    1919#include        "el.h" 
    2020#include        "oper.h" 
    2121#include        "code.h" 
    2222#include        "type.h" 
    2323#include        "global.h" 
    2424 
    2525static char __file__[] = __FILE__;      /* for tassert.h                */ 
    2626#include        "tassert.h" 
    2727 
     28/************************************* 
     29 * Handy function to answer the question: who the heck is generating this piece of code? 
     30 */ 
     31inline void ccheck(code *cs) 
     32{ 
     33//    if (cs->Iop == LEA && (cs->Irm & 0x3F) == 0x34 && cs->Isib == 7) *(char*)0=0; 
     34} 
     35 
    2836/***************************** 
    2937 * Find last code in list. 
    3038 */ 
    3139 
    3240code *code_last(code *c) 
    3341{ 
    3442    if (c) 
    3543    {   while (c->next) 
    3644            c = c->next; 
    3745    } 
    3846    return c; 
    3947} 
    4048 
    4149/***************************** 
    4250 * Set flag bits on last code in list. 
    4351 */ 
    4452 
    4553void code_orflag(code *c,unsigned flag) 
    4654{ 
    4755    if (flag && c) 
     
    145153 * Note that unused operands are garbage. 
    146154 * gen1() and gen2() are shortcut routines. 
    147155 * Input: 
    148156 *      c ->    linked list that code is to be added to end of 
    149157 *      cs ->   data for the code 
    150158 * Returns: 
    151159 *      pointer to start of code list 
    152160 */ 
    153161 
    154162code *gen(code *c,code *cs) 
    155163{   code *ce,*cstart; 
    156164    unsigned reg; 
    157165 
    158166#ifdef DEBUG                            /* this is a high usage routine */ 
    159167    assert(cs); 
    160168#endif 
    161169    assert(I64 || cs->Irex == 0); 
    162170    ce = code_calloc(); 
    163171    *ce = *cs; 
    164172    //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)
    166174    if (config.flags4 & CFG4optimized && 
    167175        ce->IFL2 == FLconst && 
    168176        (ce->Iop == 0x81 || ce->Iop == 0x80) && 
    169177        reghasvalue((ce->Iop == 0x80) ? BYTEREGS : ALLREGS,ce->IEV2.Vlong,&reg) && 
    170178        !(ce->Iflags & CFopsize && I16) 
    171179       ) 
    172180    {   // See if we can replace immediate instruction with register instruction 
    173181        static unsigned char regop[8] = 
    174182                { 0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38 }; 
    175183 
    176184        //printf("replacing 0x%02x, val = x%lx\n",ce->Iop,ce->IEV2.Vlong); 
    177185        ce->Iop = regop[(ce->Irm & modregrm(0,7,0)) >> 3] | (ce->Iop & 1); 
    178186        code_newreg(ce, reg); 
    179187    } 
    180188    code_next(ce) = CNIL; 
    181189    if (c) 
    182190    {   cstart = c; 
    183191        while (code_next(c)) c = code_next(c);  /* find end of list     */ 
    184192        code_next(c) = ce;                      /* link into list       */ 
    185193        return cstart; 
     
    192200 
    193201  ce = code_calloc(); 
    194202  ce->Iop = op; 
    195203  assert(op != LEA); 
    196204  if (c) 
    197205  {     cstart = c; 
    198206        while (code_next(c)) c = code_next(c);  /* find end of list     */ 
    199207        code_next(c) = ce;                      /* link into list       */ 
    200208        return cstart; 
    201209  } 
    202210  return ce; 
    203211} 
    204212 
    205213code *gen2(code *c,unsigned op,unsigned rm) 
    206214{ code *ce,*cstart; 
    207215 
    208216  cstart = ce = code_calloc(); 
    209217  /*cxcalloc++;*/ 
    210218  ce->Iop = op; 
    211219  ce->Iea = rm; 
     220  ccheck(ce); 
    212221  if (c) 
    213222  {     cstart = c; 
    214223        while (code_next(c)) c = code_next(c);  /* find end of list     */ 
    215224        code_next(c) = ce;                      /* link into list       */ 
    216225  } 
    217226  return cstart; 
    218227} 
    219228 
    220229code *gen2sib(code *c,unsigned op,unsigned rm,unsigned sib) 
    221230{ code *ce,*cstart; 
    222231 
    223232  cstart = ce = code_calloc(); 
    224233  /*cxcalloc++;*/ 
    225   if (op == LEA && (rm & 0xFF) == 4 && (sib & 0xFF) == 0x6D) *(char*)0=0; 
    226234  ce->Iop = op; 
    227235  ce->Irm = rm; 
    228236  ce->Isib = sib; 
    229237  ce->Irex = (rm | (sib & (REX_B << 16))) >> 16; 
    230238  if (sib & (REX_R << 16)) 
    231239        ce->Irex |= REX_X; 
     240  ccheck(ce); 
    232241  if (c) 
    233242  {     cstart = c; 
    234243        while (code_next(c)) c = code_next(c);  /* find end of list     */ 
    235244        code_next(c) = ce;                      /* link into list       */ 
    236245  } 
    237246  return cstart; 
    238247} 
    239248 
    240249code *genregs(code *c,unsigned op,unsigned dstreg,unsigned srcreg) 
    241250{ return gen2(c,op,modregxrmx(3,dstreg,srcreg)); } 
    242251 
    243252code *gentstreg(code *c,unsigned t) 
    244253{ 
    245254    c = gen2(c,0x85,modregxrmx(3,t,t));   // TEST t,t 
    246255    code_orflag(c,CFpsw); 
    247256    return c; 
    248257} 
    249258 
    250259code *genpush(code *c, unsigned reg) 
    251260{ 
     
    342351            c = genjmp(c,JP,FLcode,(block *) cnop); 
    343352            cat(cj,cnop); 
    344353            break; 
    345354        case 1 << 8:                    /* toggled no jump              */ 
    346355        case 0 << 8: 
    347356            break; 
    348357        default: 
    349358#ifdef DEBUG 
    350359            printf("jop = x%x\n",op); 
    351360#endif 
    352361            assert(0); 
    353362    } 
    354363    return cat(c,cj); 
    355364} 
    356365 
    357366code *gencs(code *c,unsigned op,unsigned ea,unsigned FL2,symbol *s) 
    358367{   code cs; 
    359368 
    360369    cs.Iop = op; 
    361370    cs.Iea = ea; 
     371    ccheck(&cs); 
    362372    cs.Iflags = 0; 
    363373    cs.IFL2 = FL2; 
    364374    cs.IEVsym2 = s; 
    365375    cs.IEVoffset2 = 0; 
    366376 
    367377    return gen(c,&cs); 
    368378} 
    369379 
    370380code *genc2(code *c,unsigned op,unsigned ea,targ_size_t EV2) 
    371381{   code cs; 
    372382 
    373383    cs.Iop = op; 
    374384    cs.Iea = ea; 
     385    ccheck(&cs); 
    375386    cs.Iflags = CFoff; 
    376387    cs.IFL2 = FLconst; 
    377388    cs.IEV2.Vsize_t = EV2; 
    378389    return gen(c,&cs); 
    379390} 
    380391 
    381392/***************** 
    382393 * Generate code. 
    383394 */ 
    384395 
    385396code *genc1(code *c,unsigned op,unsigned ea,unsigned FL1,targ_size_t EV1) 
    386397{   code cs; 
    387398 
    388399    assert(FL1 < FLMAX); 
    389400    cs.Iop = op; 
    390401    cs.Iflags = CFoff; 
    391402    cs.Iea = ea; 
     403    ccheck(&cs); 
    392404    cs.IFL1 = FL1; 
    393405    cs.IEV1.Vsize_t = EV1; 
    394 if (cs.Iop == LEA && cs.IFL1 == FLunde) *(char*)0=0; 
    395406    return gen(c,&cs); 
    396407} 
    397408 
    398409/***************** 
    399410 * Generate code. 
    400411 */ 
    401412 
    402413code *genc(code *c,unsigned op,unsigned ea,unsigned FL1,targ_size_t EV1,unsigned FL2,targ_size_t EV2) 
    403414{   code cs; 
    404415 
    405416    assert(FL1 < FLMAX); 
    406417    cs.Iop = op; 
    407418    cs.Iea = ea; 
     419    ccheck(&cs); 
    408420    cs.Iflags = CFoff; 
    409421    cs.IFL1 = FL1; 
    410422    cs.IEV1.Vsize_t = EV1; 
    411423    assert(FL2 < FLMAX); 
    412424    cs.IFL2 = FL2; 
    413425    cs.IEV2.Vsize_t = EV2; 
    414426    return gen(c,&cs); 
    415427} 
    416428 
    417429/*************************************** 
    418430 * Generate immediate multiply instruction for r1=r2*imm. 
    419431 * Optimize it into LEA's if we can. 
    420432 */ 
    421433 
    422434code *genmulimm(code *c,unsigned r1,unsigned r2,targ_int imm) 
    423435{   code cs; 
    424436 
    425437    // These optimizations should probably be put into pinholeopt() 
    426438    switch (imm) 
    427439    {   case 1: 
     
    539551 *      set flags based on result 
    540552 * Else if flags & 8 
    541553 *      do not disturb flags 
    542554 * Else 
    543555 *      don't care about flags 
    544556 * If flags & 1 then byte move 
    545557 * If flags & 2 then short move (for I32 and I64) 
    546558 * If flags & 4 then don't disturb unused portion of register 
    547559 * If flags & 16 then reg is a byte register AL..BH 
    548560 * If flags & 64 then 64 bit move (I64 only) 
    549561 * Returns: 
    550562 *      code (if any) generated 
    551563 */ 
    552564 
    553565code *movregconst(code *c,unsigned reg,targ_size_t value,regm_t flags) 
    554566{   unsigned r; 
    555567    regm_t regm; 
    556568    regm_t mreg; 
    557569    targ_size_t regv; 
    558570 
     571    //printf("movregconst(%llx)\n", value); 
    559572#define genclrreg(a,r) genregs(a,0x31,r,r) 
    560573 
    561574    regm = regcon.immed.mval & mask[reg]; 
    562575    regv = regcon.immed.value[reg]; 
    563576 
    564577    if (flags & 1)      // 8 bits 
    565578    {   unsigned msk; 
    566579 
    567580        value &= 0xFF; 
    568581        regm &= BYTEREGS; 
    569582 
    570583        // If we already have the right value in the right register 
    571584        if (regm && (regv & 0xFF) == value) 
    572585            goto L2; 
    573586 
    574587        if (flags & 16 && reg & 4 &&    // if an H byte register 
    575588            regcon.immed.mval & mask[reg & 3] && 
    576589            (((regv = regcon.immed.value[reg & 3]) >> 8) & 0xFF) == value) 
    577590            goto L2; 
    578591 
  • trunk/src/expression.c

    r767 r769  
    50735073            } 
    50745074            case TOKreturn: 
    50755075                /* Get the 'return type' for the function, 
    50765076                 * delegate, or pointer to function. 
    50775077                 */ 
    50785078                if (targ->ty == Tfunction) 
    50795079                    tded = ((TypeFunction *)targ)->next; 
    50805080                else if (targ->ty == Tdelegate) 
    50815081                {   tded = ((TypeDelegate *)targ)->next; 
    50825082                    tded = ((TypeFunction *)tded)->next; 
    50835083                } 
    50845084                else if (targ->ty == Tpointer && 
    50855085                         ((TypePointer *)targ)->next->ty == Tfunction) 
    50865086                {   tded = ((TypePointer *)targ)->next; 
    50875087                    tded = ((TypeFunction *)tded)->next; 
    50885088                } 
    50895089                else 
    50905090                    goto Lno; 
    50915091                break; 
    50925092 
     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 
    50935104            default: 
    50945105                assert(0); 
    50955106        } 
    50965107        goto Lyes; 
    50975108    } 
    50985109    else if (id && tspec) 
    50995110    { 
    51005111        /* Evaluate to TRUE if targ matches tspec. 
    51015112         * If TRUE, declare id as an alias for the specialized type. 
    51025113         */ 
    51035114 
    51045115        assert(parameters && parameters->dim); 
    51055116 
    51065117        Objects dedtypes; 
    51075118        dedtypes.setDim(parameters->dim); 
    51085119        dedtypes.zero(); 
    51095120 
    51105121        MATCH m = targ->deduceType(NULL, tspec, parameters, &dedtypes); 
    51115122//printf("targ: %s\n", targ->toChars()); 
    51125123//printf("tspec: %s\n", tspec->toChars()); 
  • trunk/src/freebsd.mak

    r605 r769  
    2525TOTALH= 
    2626 
    2727DMD_OBJS = \ 
    2828    access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 
    2929    cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 
    3030    cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 
    3131    constfold.o irstate.o dchar.o cond.o debug.o \ 
    3232    declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 
    3333    dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 
    3434    glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 
    3535    identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 
    3636    lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 
    3737    nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 
    3838    parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 
    3939    stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 
    4040    type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 
    4141    unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 
    4242    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    4343    builtin.o clone.o aliasthis.o \ 
    4444    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
    4646    libelf.o elfobj.o 
    4747 
    4848SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 
    4949    mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 
    5050    identifier.c mtype.c expression.c optimize.c template.h \ 
    5151    template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 
    5252    aggregate.h parse.c statement.c constfold.c version.h version.c \ 
    5353    inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 
    5454    attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
    5555    access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 
    5656    s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 
    5757    scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 
    5858    declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 
    5959    utf.h utf.c staticassert.h staticassert.c unialpha.c \ 
    6060    typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 
    6161    doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
    6262    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    6363    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    6464    aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 
     65    argtypes.c \ 
    6566    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6667    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
    6768    $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 
    6869    $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 
    6970    $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 
    7071    $C/cgreg.c $C/var.c $C/strtold.c \ 
    7172    $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 
    7273    $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 
    7374    $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 
    7475    $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 
    7576    $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 
    7677    $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 
    7778    $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 
    7879    $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 
    7980    $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 
    8081    $C/machobj.c \ 
    8182    $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 
    8283    $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 
    8384    $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 
    8485    $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ 
     
    125126$(impcnvtab_output) : impcnvgen 
    126127 
    127128impcnvgen : mtype.h impcnvgen.c 
    128129    $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 
    129130    ./impcnvgen 
    130131 
    131132######### 
    132133 
    133134$(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 
    134135 
    135136aa.o: $C/aa.h $C/tinfo.h $C/aa.c 
    136137    $(CC) -c $(MFLAGS) -I. $C/aa.c 
    137138 
    138139aav.o: $(ROOT)/aav.c 
    139140    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    140141 
    141142access.o: access.c 
    142143    $(CC) -c $(CFLAGS) $< 
    143144 
    144145aliasthis.o: aliasthis.c 
     146    $(CC) -c $(CFLAGS) $< 
     147 
     148argtypes.o: argtypes.c 
    145149    $(CC) -c $(CFLAGS) $< 
    146150 
    147151array.o: $(ROOT)/array.c 
    148152    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    149153 
    150154arrayop.o: arrayop.c 
    151155    $(CC) -c $(CFLAGS) $< 
    152156 
    153157async.o: $(ROOT)/async.c 
    154158    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    155159 
    156160attrib.o: attrib.c 
    157161    $(CC) -c $(CFLAGS) $< 
    158162 
    159163bcomplex.o: $C/bcomplex.c 
    160164    $(CC) -c $(MFLAGS) $< 
    161165 
    162166bit.o: expression.h bit.c 
    163167    $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 
    164168 
  • trunk/src/lexer.c

    r522 r769  
    29872987    {   "out",          TOKout          }, 
    29882988    {   "inout",        TOKinout        }, 
    29892989    {   "lazy",         TOKlazy         }, 
    29902990    {   "auto",         TOKauto         }, 
    29912991 
    29922992    {   "align",        TOKalign        }, 
    29932993    {   "extern",       TOKextern       }, 
    29942994    {   "private",      TOKprivate      }, 
    29952995    {   "package",      TOKpackage      }, 
    29962996    {   "protected",    TOKprotected    }, 
    29972997    {   "public",       TOKpublic       }, 
    29982998    {   "export",       TOKexport       }, 
    29992999 
    30003000    {   "body",         TOKbody         }, 
    30013001    {   "invariant",    TOKinvariant    }, 
    30023002    {   "unittest",     TOKunittest     }, 
    30033003    {   "version",      TOKversion      }, 
    30043004    //{ "manifest",     TOKmanifest     }, 
    30053005 
    30063006    // Added after 1.0 
     3007    {   "__argTypes",   TOKargTypes     }, 
    30073008    {   "ref",          TOKref          }, 
    30083009    {   "macro",        TOKmacro        }, 
    30093010#if DMDV2 
    30103011    {   "pure",         TOKpure         }, 
    30113012    {   "nothrow",      TOKnothrow      }, 
    30123013    {   "__thread",     TOKtls          }, 
    30133014    {   "__gshared",    TOKgshared      }, 
    30143015    {   "__traits",     TOKtraits       }, 
    30153016    {   "__overloadset", TOKoverloadset }, 
    30163017    {   "__FILE__",     TOKfile         }, 
    30173018    {   "__LINE__",     TOKline         }, 
    30183019    {   "shared",       TOKshared       }, 
    30193020    {   "immutable",    TOKimmutable    }, 
    30203021#endif 
    30213022}; 
    30223023 
    30233024int Token::isKeyword() 
    30243025{ 
    30253026    for (unsigned u = 0; u < sizeof(keywords) / sizeof(keywords[0]); u++) 
    30263027    { 
  • trunk/src/lexer.h

    r522 r769  
    135135        TOKalign, TOKextern, TOKprivate, TOKprotected, TOKpublic, TOKexport, 
    136136        TOKstatic, /*TOKvirtual,*/ TOKfinal, TOKconst, TOKabstract, TOKvolatile, 
    137137        TOKdebug, TOKdeprecated, TOKin, TOKout, TOKinout, TOKlazy, 
    138138        TOKauto, TOKpackage, TOKmanifest, TOKimmutable, 
    139139 
    140140        // Statements 
    141141        TOKif, TOKelse, TOKwhile, TOKfor, TOKdo, TOKswitch, 
    142142        TOKcase, TOKdefault, TOKbreak, TOKcontinue, TOKwith, 
    143143        TOKsynchronized, TOKreturn, TOKgoto, TOKtry, TOKcatch, TOKfinally, 
    144144        TOKasm, TOKforeach, TOKforeach_reverse, 
    145145        TOKscope, 
    146146        TOKon_scope_exit, TOKon_scope_failure, TOKon_scope_success, 
    147147 
    148148        // Contracts 
    149149        TOKbody, TOKinvariant, 
    150150 
    151151        // Testing 
    152152        TOKunittest, 
    153153 
    154154        // Added after 1.0 
     155        TOKargTypes, 
    155156        TOKref, 
    156157        TOKmacro, 
    157158#if DMDV2 
    158159        TOKtraits, 
    159160        TOKoverloadset, 
    160161        TOKpure, 
    161162        TOKnothrow, 
    162163        TOKtls, 
    163164        TOKgshared, 
    164165        TOKline, 
    165166        TOKfile, 
    166167        TOKshared, 
    167168        TOKat, 
    168169        TOKpow, 
    169170        TOKpowass, 
    170171#endif 
    171172 
    172173        TOKMAX 
    173174}; 
    174175 
  • trunk/src/linux.mak

    r577 r769  
    2525TOTALH= 
    2626 
    2727DMD_OBJS = \ 
    2828    access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 
    2929    cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 
    3030    cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 
    3131    constfold.o irstate.o dchar.o cond.o debug.o \ 
    3232    declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 
    3333    dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 
    3434    glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 
    3535    identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 
    3636    lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 
    3737    nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 
    3838    parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 
    3939    stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 
    4040    type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 
    4141    unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 
    4242    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    4343    builtin.o clone.o aliasthis.o \ 
    4444    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
    4646    libelf.o elfobj.o 
    4747 
    4848SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 
    4949    mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 
    5050    identifier.c mtype.c expression.c optimize.c template.h \ 
    5151    template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 
    5252    aggregate.h parse.c statement.c constfold.c version.h version.c \ 
    5353    inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 
    5454    attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
    5555    access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 
    5656    s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 
    5757    scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 
    5858    declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 
    5959    utf.h utf.c staticassert.h staticassert.c unialpha.c \ 
    6060    typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 
    6161    doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
    6262    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    6363    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    6464    aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 
     65    argtypes.c \ 
    6566    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6667    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
    6768    $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 
    6869    $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 
    6970    $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 
    7071    $C/cgreg.c $C/var.c $C/strtold.c \ 
    7172    $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 
    7273    $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 
    7374    $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 
    7475    $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 
    7576    $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 
    7677    $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 
    7778    $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 
    7879    $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 
    7980    $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 
    8081    $C/machobj.c \ 
    8182    $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 
    8283    $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 
    8384    $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 
    8485    $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ 
     
    125126$(impcnvtab_output) : impcnvgen 
    126127 
    127128impcnvgen : mtype.h impcnvgen.c 
    128129    $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 
    129130    ./impcnvgen 
    130131 
    131132######### 
    132133 
    133134$(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 
    134135 
    135136aa.o: $C/aa.h $C/tinfo.h $C/aa.c 
    136137    $(CC) -c $(MFLAGS) -I. $C/aa.c 
    137138 
    138139aav.o: $(ROOT)/aav.c 
    139140    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    140141 
    141142access.o: access.c 
    142143    $(CC) -c $(CFLAGS) $< 
    143144 
    144145aliasthis.o: aliasthis.c 
     146    $(CC) -c $(CFLAGS) $< 
     147 
     148argtypes.o: argtypes.c 
    145149    $(CC) -c $(CFLAGS) $< 
    146150 
    147151array.o: $(ROOT)/array.c 
    148152    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    149153 
    150154arrayop.o: arrayop.c 
    151155    $(CC) -c $(CFLAGS) $< 
    152156 
    153157async.o: $(ROOT)/async.c 
    154158    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    155159 
    156160attrib.o: attrib.c 
    157161    $(CC) -c $(CFLAGS) $< 
    158162 
    159163bcomplex.o: $C/bcomplex.c 
    160164    $(CC) -c $(MFLAGS) $< 
    161165 
    162166bit.o: expression.h bit.c 
    163167    $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 
    164168 
  • trunk/src/mtype.c

    r767 r769  
    61066106            Identifier *id = (Identifier *)idents.data[i]; 
    61076107            s = s->searchX(loc, sc, id); 
    61086108        } 
    61096109 
    61106110        if (s) 
    61116111        { 
    61126112            t = s->getType(); 
    61136113            if (!t) 
    61146114            {   error(loc, "%s is not a type", s->toChars()); 
    61156115                goto Lerr; 
    61166116            } 
    61176117        } 
    61186118        else 
    61196119        {   error(loc, "cannot resolve .property for %s", toChars()); 
    61206120            goto Lerr; 
    61216121        } 
    61226122    } 
    61236123    return t; 
    61246124 
    61256125Lerr: 
    6126     return tvoid
     6126    return terror
    61276127} 
    61286128 
    61296129d_uns64 TypeTypeof::size(Loc loc) 
    61306130{ 
    61316131    if (exp->type) 
    61326132        return exp->type->size(loc); 
    61336133    else 
    61346134        return TypeQualified::size(loc); 
    61356135} 
    61366136 
    61376137 
    61386138 
    61396139/***************************** TypeReturn *****************************/ 
    61406140 
    61416141TypeReturn::TypeReturn(Loc loc) 
    61426142        : TypeQualified(Treturn, loc) 
    61436143{ 
    61446144} 
    61456145 
    61466146Type *TypeReturn::syntaxCopy() 
     
    76577657 
    76587658TypeTuple::TypeTuple(Expressions *exps) 
    76597659    : Type(Ttuple) 
    76607660{ 
    76617661    Parameters *arguments = new Parameters; 
    76627662    if (exps) 
    76637663    { 
    76647664        arguments->setDim(exps->dim); 
    76657665        for (size_t i = 0; i < exps->dim; i++) 
    76667666        {   Expression *e = (Expression *)exps->data[i]; 
    76677667            if (e->type->ty == Ttuple) 
    76687668                e->error("cannot form tuple of tuples"); 
    76697669            Parameter *arg = new Parameter(STCundefined, e->type, NULL, NULL); 
    76707670            arguments->data[i] = (void *)arg; 
    76717671        } 
    76727672    } 
    76737673    this->arguments = arguments; 
    76747674    //printf("TypeTuple() %p, %s\n", this, toChars()); 
    76757675} 
    76767676 
     7677/******************************************* 
     7678 * Type tuple with 0, 1 or 2 types in it. 
     7679 */ 
     7680TypeTuple::TypeTuple() 
     7681    : Type(Ttuple) 
     7682{ 
     7683    arguments = new Parameters(); 
     7684} 
     7685 
     7686TypeTuple::TypeTuple(Type *t1) 
     7687    : Type(Ttuple) 
     7688{ 
     7689    arguments = new Parameters(); 
     7690    arguments->push(new Parameter(0, t1, NULL, NULL)); 
     7691} 
     7692 
     7693TypeTuple::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 
    76777701Type *TypeTuple::syntaxCopy() 
    76787702{ 
    76797703    Parameters *args = Parameter::arraySyntaxCopy(arguments); 
    76807704    Type *t = new TypeTuple(args); 
    76817705    t->mod = mod; 
    76827706    return t; 
    76837707} 
    76847708 
    76857709Type *TypeTuple::semantic(Loc loc, Scope *sc) 
    76867710{ 
    76877711    //printf("TypeTuple::semantic(this = %p)\n", this); 
    76887712    //printf("TypeTuple::semantic() %p, %s\n", this, toChars()); 
    76897713    if (!deco) 
    76907714        deco = merge()->deco; 
    76917715 
    76927716    /* Don't return merge(), because a tuple with one type has the 
    76937717     * same deco as that type. 
    76947718     */ 
    76957719    return this; 
    76967720} 
  • trunk/src/mtype.h

    r768 r769  
    3131struct TypedefDeclaration; 
    3232struct TypeInfoDeclaration; 
    3333struct Dsymbol; 
    3434struct TemplateInstance; 
    3535struct CppMangleState; 
    3636struct TemplateDeclaration; 
    3737enum LINK; 
    3838 
    3939struct TypeBasic; 
    4040struct HdrGenState; 
    4141struct Parameter; 
    4242 
    4343// Back end 
    4444#if IN_GCC 
    4545union tree_node; typedef union tree_node TYPE; 
    4646typedef TYPE type; 
    4747#else 
    4848typedef struct TYPE type; 
    4949#endif 
    5050struct Symbol; 
     51struct TypeTuple; 
    5152 
    5253enum ENUMTY 
    5354{ 
    5455    Tarray,             // slice array, aka T[] 
    5556    Tsarray,            // static array, aka T[dimension] 
    5657    Tnarray,            // resizable array, aka T[new] 
    5758    Taarray,            // associative array, aka T[type] 
    5859    Tpointer, 
    5960    Treference, 
    6061    Tfunction, 
    6162    Tident, 
    6263    Tclass, 
    6364    Tstruct, 
    6465 
    6566    Tenum, 
    6667    Ttypedef, 
    6768    Tdelegate, 
    6869    Tnone, 
    6970    Tvoid, 
    7071    Tint8, 
     
    292293    virtual Expression *getProperty(Loc loc, Identifier *ident); 
    293294    virtual Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    294295    Expression *noMember(Scope *sc, Expression *e, Identifier *ident); 
    295296    virtual unsigned memalign(unsigned salign); 
    296297    virtual Expression *defaultInit(Loc loc = 0); 
    297298    virtual Expression *defaultInitLiteral(Loc loc = 0); 
    298299    virtual int isZeroInit(Loc loc = 0);                // if initializer is 0 
    299300    virtual dt_t **toDt(dt_t **pdt); 
    300301    Identifier *getTypeInfoIdent(int internal); 
    301302    virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    302303    virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 
    303304    Expression *getInternalTypeInfo(Scope *sc); 
    304305    Expression *getTypeInfo(Scope *sc); 
    305306    virtual TypeInfoDeclaration *getTypeInfoDeclaration(); 
    306307    virtual int builtinTypeInfo(); 
    307308    virtual Type *reliesOnTident(); 
    308309    virtual int hasWild(); 
    309310    virtual unsigned wildMatch(Type *targ); 
    310311    virtual Expression *toExpression(); 
    311312    virtual int hasPointers(); 
     313    virtual TypeTuple *toArgTypes(); 
    312314    virtual Type *nextOf(); 
    313315    uinteger_t sizemask(); 
    314316 
    315317    static void error(Loc loc, const char *format, ...); 
    316318    static void warning(Loc loc, const char *format, ...); 
    317319 
    318320    // For backend 
    319321    virtual unsigned totym(); 
    320322    virtual type *toCtype(); 
    321323    virtual type *toCParamtype(); 
    322324    virtual Symbol *toSymbol(); 
    323325 
    324326    // For eliminating dynamic_cast 
    325327    virtual TypeBasic *isTypeBasic(); 
    326328}; 
    327329 
    328330struct TypeError : Type 
    329331{ 
    330332    TypeError(); 
    331333 
     
    371373    unsigned alignsize(); 
    372374    Expression *getProperty(Loc loc, Identifier *ident); 
    373375    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    374376    char *toChars(); 
    375377    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    376378#if CPP_MANGLE 
    377379    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    378380#endif 
    379381    int isintegral(); 
    380382    int isbit(); 
    381383    int isfloating(); 
    382384    int isreal(); 
    383385    int isimaginary(); 
    384386    int iscomplex(); 
    385387    int isscalar(); 
    386388    int isunsigned(); 
    387389    MATCH implicitConvTo(Type *to); 
    388390    Expression *defaultInit(Loc loc); 
    389391    int isZeroInit(Loc loc); 
    390392    int builtinTypeInfo(); 
     393    TypeTuple *toArgTypes(); 
    391394 
    392395    // For eliminating dynamic_cast 
    393396    TypeBasic *isTypeBasic(); 
    394397}; 
    395398 
    396399struct TypeArray : TypeNext 
    397400{ 
    398401    TypeArray(TY ty, Type *next); 
    399402    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    400403}; 
    401404 
    402405// Static array, one with a fixed dimension 
    403406struct TypeSArray : TypeArray 
    404407{ 
    405408    Expression *dim; 
    406409 
    407410    TypeSArray(Type *t, Expression *dim); 
    408411    Type *syntaxCopy(); 
    409412    d_uns64 size(Loc loc); 
    410413    unsigned alignsize(); 
    411414    Type *semantic(Loc loc, Scope *sc); 
    412415    void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 
    413416    void toDecoBuffer(OutBuffer *buf, int flag); 
    414417    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    415418    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    416419    int isString(); 
    417420    int isZeroInit(Loc loc); 
    418421    unsigned memalign(unsigned salign); 
    419422    MATCH constConv(Type *to); 
    420423    MATCH implicitConvTo(Type *to); 
    421424    Expression *defaultInit(Loc loc); 
    422425    Expression *defaultInitLiteral(Loc loc); 
    423426    dt_t **toDt(dt_t **pdt); 
    424427    dt_t **toDtElem(dt_t **pdt, Expression *e); 
    425428    MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    426429    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    427430    Expression *toExpression(); 
    428431    int hasPointers(); 
     432    TypeTuple *toArgTypes(); 
    429433#if CPP_MANGLE 
    430434    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    431435#endif 
    432436 
    433437    type *toCtype(); 
    434438    type *toCParamtype(); 
    435439}; 
    436440 
    437441// Dynamic array, no dimension 
    438442struct TypeDArray : TypeArray 
    439443{ 
    440444    TypeDArray(Type *t); 
    441445    Type *syntaxCopy(); 
    442446    d_uns64 size(Loc loc); 
    443447    unsigned alignsize(); 
    444448    Type *semantic(Loc loc, Scope *sc); 
    445449    void toDecoBuffer(OutBuffer *buf, int flag); 
    446450    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    447451    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    448452    int isString(); 
    449453    int isZeroInit(Loc loc); 
    450454    int checkBoolean(); 
    451455    MATCH implicitConvTo(Type *to); 
    452456    Expression *defaultInit(Loc loc); 
    453457    int builtinTypeInfo(); 
    454458    MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    455459    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    456460    int hasPointers(); 
     461    TypeTuple *toArgTypes(); 
    457462#if CPP_MANGLE 
    458463    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    459464#endif 
    460465 
    461466    type *toCtype(); 
    462467}; 
    463468 
    464469struct TypeAArray : TypeArray 
    465470{ 
    466471    Type *index;                // key type 
    467472    Loc loc; 
    468473    Scope *sc; 
    469474 
    470475    StructDeclaration *impl;    // implementation 
    471476 
    472477    TypeAArray(Type *t, Type *index); 
    473478    Type *syntaxCopy(); 
    474479    d_uns64 size(Loc loc); 
    475480    Type *semantic(Loc loc, Scope *sc); 
    476481    StructDeclaration *getImpl(); 
    477482    void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 
    478483    void toDecoBuffer(OutBuffer *buf, int flag); 
    479484    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    480485    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    481486    Expression *defaultInit(Loc loc); 
    482487    MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    483488    int isZeroInit(Loc loc); 
    484489    int checkBoolean(); 
    485490    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    486491    int hasPointers(); 
     492    TypeTuple *toArgTypes(); 
    487493    MATCH implicitConvTo(Type *to); 
    488494    MATCH constConv(Type *to); 
    489495#if CPP_MANGLE 
    490496    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    491497#endif 
    492498 
    493499    // Back end 
    494500    Symbol *aaGetSymbol(const char *func, int flags); 
    495501 
    496502    type *toCtype(); 
    497503}; 
    498504 
    499505struct TypePointer : TypeNext 
    500506{ 
    501507    TypePointer(Type *t); 
    502508    Type *syntaxCopy(); 
    503509    Type *semantic(Loc loc, Scope *sc); 
    504510    d_uns64 size(Loc loc); 
    505511    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    506512    MATCH implicitConvTo(Type *to); 
    507513    int isscalar(); 
    508514    Expression *defaultInit(Loc loc); 
    509515    int isZeroInit(Loc loc); 
    510516    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    511517    int hasPointers(); 
     518    TypeTuple *toArgTypes(); 
    512519#if CPP_MANGLE 
    513520    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    514521#endif 
    515522 
    516523    type *toCtype(); 
    517524}; 
    518525 
    519526struct TypeReference : TypeNext 
    520527{ 
    521528    TypeReference(Type *t); 
    522529    Type *syntaxCopy(); 
    523530    Type *semantic(Loc loc, Scope *sc); 
    524531    d_uns64 size(Loc loc); 
    525532    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    526533    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    527534    Expression *defaultInit(Loc loc); 
    528535    int isZeroInit(Loc loc); 
    529536#if CPP_MANGLE 
    530537    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    531538#endif 
     
    594601    unsigned totym(); 
    595602}; 
    596603 
    597604struct TypeDelegate : TypeNext 
    598605{ 
    599606    // .next is a TypeFunction 
    600607 
    601608    TypeDelegate(Type *t); 
    602609    Type *syntaxCopy(); 
    603610    Type *semantic(Loc loc, Scope *sc); 
    604611    d_uns64 size(Loc loc); 
    605612    unsigned alignsize(); 
    606613    MATCH implicitConvTo(Type *to); 
    607614    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    608615    Expression *defaultInit(Loc loc); 
    609616    int isZeroInit(Loc loc); 
    610617    int checkBoolean(); 
    611618    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    612619    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    613620    int hasPointers(); 
     621    TypeTuple *toArgTypes(); 
    614622#if CPP_MANGLE 
    615623    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    616624#endif 
    617625 
    618626    type *toCtype(); 
    619627}; 
    620628 
    621629struct TypeQualified : Type 
    622630{ 
    623631    Loc loc; 
    624632    Array idents;       // array of Identifier's representing ident.ident.ident etc. 
    625633 
    626634    TypeQualified(TY ty, Loc loc); 
    627635    void syntaxCopyHelper(TypeQualified *t); 
    628636    void addIdent(Identifier *ident); 
    629637    void toCBuffer2Helper(OutBuffer *buf, HdrGenState *hgs); 
    630638    d_uns64 size(Loc loc); 
    631639    void resolveHelper(Loc loc, Scope *sc, Dsymbol *s, Dsymbol *scopesym, 
    632640        Expression **pe, Type **pt, Dsymbol **ps); 
    633641}; 
     
    694702    TypeStruct(StructDeclaration *sym); 
    695703    d_uns64 size(Loc loc); 
    696704    unsigned alignsize(); 
    697705    char *toChars(); 
    698706    Type *syntaxCopy(); 
    699707    Type *semantic(Loc loc, Scope *sc); 
    700708    Dsymbol *toDsymbol(Scope *sc); 
    701709    void toDecoBuffer(OutBuffer *buf, int flag); 
    702710    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    703711    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    704712    unsigned memalign(unsigned salign); 
    705713    Expression *defaultInit(Loc loc); 
    706714    Expression *defaultInitLiteral(Loc loc); 
    707715    int isZeroInit(Loc loc); 
    708716    int isAssignable(); 
    709717    int checkBoolean(); 
    710718    dt_t **toDt(dt_t **pdt); 
    711719    MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    712720    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    713721    int hasPointers(); 
     722    TypeTuple *toArgTypes(); 
    714723    MATCH implicitConvTo(Type *to); 
    715724    MATCH constConv(Type *to); 
    716725    Type *toHeadMutable(); 
    717726#if CPP_MANGLE 
    718727    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    719728#endif 
    720729 
    721730    type *toCtype(); 
    722731}; 
    723732 
    724733struct TypeEnum : Type 
    725734{ 
    726735    EnumDeclaration *sym; 
    727736 
    728737    TypeEnum(EnumDeclaration *sym); 
    729738    Type *syntaxCopy(); 
    730739    d_uns64 size(Loc loc); 
    731740    unsigned alignsize(); 
    732741    char *toChars(); 
    733742    Type *semantic(Loc loc, Scope *sc); 
     
    736745    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    737746    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    738747    Expression *getProperty(Loc loc, Identifier *ident); 
    739748    int isintegral(); 
    740749    int isfloating(); 
    741750    int isreal(); 
    742751    int isimaginary(); 
    743752    int iscomplex(); 
    744753    int isscalar(); 
    745754    int isunsigned(); 
    746755    int checkBoolean(); 
    747756    int isAssignable(); 
    748757    MATCH implicitConvTo(Type *to); 
    749758    MATCH constConv(Type *to); 
    750759    Type *toBasetype(); 
    751760    Expression *defaultInit(Loc loc); 
    752761    int isZeroInit(Loc loc); 
    753762    MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    754763    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    755764    int hasPointers(); 
     765    TypeTuple *toArgTypes(); 
    756766#if CPP_MANGLE 
    757767    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    758768#endif 
    759769 
    760770    type *toCtype(); 
    761771}; 
    762772 
    763773struct TypeTypedef : Type 
    764774{ 
    765775    TypedefDeclaration *sym; 
    766776 
    767777    TypeTypedef(TypedefDeclaration *sym); 
    768778    Type *syntaxCopy(); 
    769779    d_uns64 size(Loc loc); 
    770780    unsigned alignsize(); 
    771781    char *toChars(); 
    772782    Type *semantic(Loc loc, Scope *sc); 
    773783    Dsymbol *toDsymbol(Scope *sc); 
    774784    void toDecoBuffer(OutBuffer *buf, int flag); 
    775785    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
     
    778788    int isbit(); 
    779789    int isintegral(); 
    780790    int isfloating(); 
    781791    int isreal(); 
    782792    int isimaginary(); 
    783793    int iscomplex(); 
    784794    int isscalar(); 
    785795    int isunsigned(); 
    786796    int checkBoolean(); 
    787797    int isAssignable(); 
    788798    Type *toBasetype(); 
    789799    MATCH implicitConvTo(Type *to); 
    790800    MATCH constConv(Type *to); 
    791801    Expression *defaultInit(Loc loc); 
    792802    Expression *defaultInitLiteral(Loc loc); 
    793803    int isZeroInit(Loc loc); 
    794804    dt_t **toDt(dt_t **pdt); 
    795805    MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    796806    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    797807    int hasPointers(); 
     808    TypeTuple *toArgTypes(); 
    798809    int hasWild(); 
    799810    Type *toHeadMutable(); 
    800811#if CPP_MANGLE 
    801812    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    802813#endif 
    803814 
    804815    type *toCtype(); 
    805816    type *toCParamtype(); 
    806817}; 
    807818 
    808819struct TypeClass : Type 
    809820{ 
    810821    ClassDeclaration *sym; 
    811822 
    812823    TypeClass(ClassDeclaration *sym); 
    813824    d_uns64 size(Loc loc); 
    814825    char *toChars(); 
    815826    Type *syntaxCopy(); 
    816827    Type *semantic(Loc loc, Scope *sc); 
    817828    Dsymbol *toDsymbol(Scope *sc); 
    818829    void toDecoBuffer(OutBuffer *buf, int flag); 
    819830    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    820831    Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); 
    821832    ClassDeclaration *isClassHandle(); 
    822833    int isBaseOf(Type *t, int *poffset); 
    823834    MATCH implicitConvTo(Type *to); 
    824835    Expression *defaultInit(Loc loc); 
    825836    int isZeroInit(Loc loc); 
    826837    MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); 
    827838    int isscope(); 
    828839    int checkBoolean(); 
    829840    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    830841    int hasPointers(); 
     842    TypeTuple *toArgTypes(); 
    831843    int builtinTypeInfo(); 
    832844#if DMDV2 
    833845    Type *toHeadMutable(); 
    834846    MATCH constConv(Type *to); 
    835847#if CPP_MANGLE 
    836848    void toCppMangle(OutBuffer *buf, CppMangleState *cms); 
    837849#endif 
    838850#endif 
    839851 
    840852    type *toCtype(); 
    841853 
    842854    Symbol *toSymbol(); 
    843855}; 
    844856 
    845857struct TypeTuple : Type 
    846858{ 
    847859    Parameters *arguments;      // types making up the tuple 
    848860 
    849861    TypeTuple(Parameters *arguments); 
    850862    TypeTuple(Expressions *exps); 
     863    TypeTuple(); 
     864    TypeTuple(Type *t1); 
     865    TypeTuple(Type *t1, Type *t2); 
    851866    Type *syntaxCopy(); 
    852867    Type *semantic(Loc loc, Scope *sc); 
    853868    int equals(Object *o); 
    854869    Type *reliesOnTident(); 
    855870    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
    856871    void toDecoBuffer(OutBuffer *buf, int flag); 
    857872    Expression *getProperty(Loc loc, Identifier *ident); 
    858873    TypeInfoDeclaration *getTypeInfoDeclaration(); 
    859874}; 
    860875 
    861876struct TypeSlice : TypeNext 
    862877{ 
    863878    Expression *lwr; 
    864879    Expression *upr; 
    865880 
    866881    TypeSlice(Type *next, Expression *lwr, Expression *upr); 
    867882    Type *syntaxCopy(); 
    868883    Type *semantic(Loc loc, Scope *sc); 
    869884    void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); 
    870885    void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); 
  • trunk/src/osx.mak

    r577 r769  
    3131TOTALH= 
    3232 
    3333DMD_OBJS = \ 
    3434    access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 
    3535    cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 
    3636    cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 
    3737    constfold.o irstate.o dchar.o cond.o debug.o \ 
    3838    declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 
    3939    dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 
    4040    glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 
    4141    identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 
    4242    lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 
    4343    nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 
    4444    parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 
    4545    stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 
    4646    type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 
    4747    unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 
    4848    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    4949    builtin.o clone.o aliasthis.o \ 
    5050    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
    5252    libmach.o machobj.o 
    5353 
    5454SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 
    5555    mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 
    5656    identifier.c mtype.c expression.c optimize.c template.h \ 
    5757    template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 
    5858    aggregate.h parse.c statement.c constfold.c version.h version.c \ 
    5959    inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 
    6060    attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
    6161    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
    6363    scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 
    6464    declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 
    6565    utf.h utf.c staticassert.h staticassert.c unialpha.c \ 
    6666    typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 
    6767    doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
    6868    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    6969    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    7070    aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 
     71    argtypes.c \ 
    7172    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    7273    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
    7374    $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 
    7475    $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 
    7576    $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 
    7677    $C/cgreg.c $C/var.c $C/strtold.c \ 
    7778    $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 
    7879    $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 
    7980    $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 
    8081    $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 
    8182    $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 
    8283    $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 
    8384    $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 
    8485    $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 
    8586    $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 
    8687    $C/machobj.c \ 
    8788    $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 
    8889    $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 
    8990    $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 
    9091    $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ 
     
    131132$(impcnvtab_output) : impcnvgen 
    132133 
    133134impcnvgen : mtype.h impcnvgen.c 
    134135    ${ENVP} $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 
    135136    ./impcnvgen 
    136137 
    137138######### 
    138139 
    139140$(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 
    140141 
    141142aa.o: $C/aa.h $C/tinfo.h $C/aa.c 
    142143    $(CC) -c $(MFLAGS) -I. $C/aa.c 
    143144 
    144145aav.o: $(ROOT)/aav.c 
    145146    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    146147 
    147148access.o: access.c 
    148149    $(CC) -c $(CFLAGS) $< 
    149150 
    150151aliasthis.o: aliasthis.c 
     152    $(CC) -c $(CFLAGS) $< 
     153 
     154argtypes.o: argtypes.c 
    151155    $(CC) -c $(CFLAGS) $< 
    152156 
    153157array.o: $(ROOT)/array.c 
    154158    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    155159 
    156160arrayop.o: arrayop.c 
    157161    $(CC) -c $(CFLAGS) $< 
    158162 
    159163async.o: $(ROOT)/async.c 
    160164    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    161165 
    162166attrib.o: attrib.c 
    163167    $(CC) -c $(CFLAGS) $< 
    164168 
    165169bcomplex.o: $C/bcomplex.c 
    166170    $(CC) -c $(MFLAGS) $C/bcomplex.c 
    167171 
    168172bit.o: expression.h bit.c 
    169173    $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 
    170174 
  • trunk/src/parse.c

    r707 r769  
    51555155            TemplateParameters *tpl = NULL; 
    51565156            Loc loc = this->loc; 
    51575157 
    51585158            nextToken(); 
    51595159            if (token.value == TOKlparen) 
    51605160            { 
    51615161                nextToken(); 
    51625162                targ = parseType(&ident); 
    51635163                if (token.value == TOKcolon || token.value == TOKequal) 
    51645164                { 
    51655165                    tok = token.value; 
    51665166                    nextToken(); 
    51675167                    if (tok == TOKequal && 
    51685168                        (token.value == TOKtypedef || 
    51695169                         token.value == TOKstruct || 
    51705170                         token.value == TOKunion || 
    51715171                         token.value == TOKclass || 
    51725172                         token.value == TOKsuper || 
    51735173                         token.value == TOKenum || 
    51745174                         token.value == TOKinterface || 
     5175                         token.value == TOKargTypes || 
    51755176#if DMDV2 
    51765177                         token.value == TOKconst && peek(&token)->value == TOKrparen || 
    51775178                         token.value == TOKinvariant && peek(&token)->value == TOKrparen || 
    51785179                         token.value == TOKimmutable && peek(&token)->value == TOKrparen || 
    51795180                         token.value == TOKshared && peek(&token)->value == TOKrparen || 
    51805181                         token.value == TOKwild && peek(&token)->value == TOKrparen || 
    51815182#endif 
    51825183                         token.value == TOKfunction || 
    51835184                         token.value == TOKdelegate || 
    51845185                         token.value == TOKreturn)) 
    51855186                    { 
    51865187                        tok2 = token.value; 
    51875188                        nextToken(); 
    51885189                    } 
    51895190                    else 
    51905191                    { 
    51915192                        tspec = parseType(); 
    51925193                    } 
    51935194                } 
    51945195                if (ident && tspec) 
  • trunk/src/solaris.mak

    r599 r769  
    2525TOTALH= 
    2626 
    2727DMD_OBJS = \ 
    2828    access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 
    2929    cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 
    3030    cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 
    3131    constfold.o irstate.o dchar.o cond.o debug.o \ 
    3232    declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 
    3333    dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 
    3434    glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 
    3535    identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 
    3636    lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 
    3737    nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 
    3838    parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 
    3939    stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 
    4040    type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 
    4141    unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 
    4242    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
    4343    builtin.o clone.o aliasthis.o \ 
    4444    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
    4646    libelf.o elfobj.o 
    4747 
    4848SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 
    4949    mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 
    5050    identifier.c mtype.c expression.c optimize.c template.h \ 
    5151    template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 
    5252    aggregate.h parse.c statement.c constfold.c version.h version.c \ 
    5353    inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 
    5454    attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
    5555    access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 
    5656    s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 
    5757    scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 
    5858    declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 
    5959    utf.h utf.c staticassert.h staticassert.c unialpha.c \ 
    6060    typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 
    6161    doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
    6262    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
    6363    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    6464    aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 
     65    argtypes.c \ 
    6566    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
    6667    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
    6768    $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 
    6869    $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 
    6970    $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 
    7071    $C/cgreg.c $C/var.c $C/strtold.c \ 
    7172    $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 
    7273    $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 
    7374    $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 
    7475    $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 
    7576    $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 
    7677    $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 
    7778    $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 
    7879    $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 
    7980    $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 
    8081    $C/machobj.c \ 
    8182    $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 
    8283    $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 
    8384    $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 
    8485    $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ 
     
    125126$(impcnvtab_output) : impcnvgen 
    126127 
    127128impcnvgen : mtype.h impcnvgen.c 
    128129    $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 
    129130    ./impcnvgen 
    130131 
    131132######### 
    132133 
    133134$(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 
    134135 
    135136aa.o: $C/aa.h $C/tinfo.h $C/aa.c 
    136137    $(CC) -c $(MFLAGS) -I. $C/aa.c 
    137138 
    138139aav.o: $(ROOT)/aav.c 
    139140    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    140141 
    141142access.o: access.c 
    142143    $(CC) -c $(CFLAGS) $< 
    143144 
    144145aliasthis.o: aliasthis.c 
     146    $(CC) -c $(CFLAGS) $< 
     147 
     148argtypes.o: argtypes.c 
    145149    $(CC) -c $(CFLAGS) $< 
    146150 
    147151array.o: $(ROOT)/array.c 
    148152    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    149153 
    150154arrayop.o: arrayop.c 
    151155    $(CC) -c $(CFLAGS) $< 
    152156 
    153157async.o: $(ROOT)/async.c 
    154158    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
    155159 
    156160attrib.o: attrib.c 
    157161    $(CC) -c $(CFLAGS) $< 
    158162 
    159163bcomplex.o: $C/bcomplex.c 
    160164    $(CC) -c $(MFLAGS) $< 
    161165 
    162166bit.o: expression.h bit.c 
    163167    $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 
    164168 
  • trunk/src/typinf.c

    r750 r769  
    606606    // xdtor 
    607607    FuncDeclaration *sdtor = sd->dtor; 
    608608    if (sdtor) 
    609609        dtxoff(pdt, sdtor->toSymbol(), 0, TYnptr); 
    610610    else 
    611611        dtsize_t(pdt, 0);                        // xdtor 
    612612 
    613613    // xpostblit 
    614614    FuncDeclaration *spostblit = sd->postblit; 
    615615    if (spostblit) 
    616616        dtxoff(pdt, spostblit->toSymbol(), 0, TYnptr); 
    617617    else 
    618618        dtsize_t(pdt, 0);                        // xpostblit 
    619619#endif 
    620620 
    621621    // uint m_align; 
    622622    dtsize_t(pdt, tc->alignsize()); 
    623623 
    624624    if (global.params.isX86_64) 
    625625    { 
    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        } 
    628640    } 
    629641 
    630642    // name[] 
    631643    dtnbytes(pdt, namelen + 1, name); 
    632644} 
    633645 
    634646void TypeInfoClassDeclaration::toDt(dt_t **pdt) 
    635647{ 
    636648    //printf("TypeInfoClassDeclaration::toDt() %s\n", tinfo->toChars()); 
    637649#if DMDV1 
    638650    dtxoff(pdt, Type::typeinfoclass->toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoClass 
    639651    dtsize_t(pdt, 0);                        // monitor 
    640652 
    641653    assert(tinfo->ty == Tclass); 
    642654 
    643655    TypeClass *tc = (TypeClass *)tinfo; 
    644656    Symbol *s; 
    645657 
    646658    if (!tc->sym->vclassinfo) 
    647659        tc->sym->vclassinfo = new ClassInfoDeclaration(tc->sym); 
  • trunk/src/win32.mak

    r613 r769  
    6464 
    6565debdmd: 
    6666    $(MAKE) OPT= "DEBUG=-D -g -DUNITTEST" LFLAGS=-L/ma/co dmd.exe 
    6767 
    6868######################################### 
    6969 
    7070# D front end 
    7171 
    7272OBJ1= mars.obj enum.obj struct.obj dsymbol.obj import.obj id.obj \ 
    7373    staticassert.obj identifier.obj mtype.obj expression.obj \ 
    7474    optimize.obj template.obj lexer.obj declaration.obj cast.obj \ 
    7575    init.obj func.obj utf.obj unialpha.obj parse.obj statement.obj \ 
    7676    constfold.obj version.obj inifile.obj typinf.obj \ 
    7777    module.obj scope.obj dump.obj cond.obj inline.obj opover.obj \ 
    7878    entity.obj class.obj mangle.obj attrib.obj impcnvtab.obj \ 
    7979    link.obj access.obj doc.obj macro.obj hdrgen.obj delegatize.obj \ 
    8080    interpret.obj traits.obj aliasthis.obj \ 
    8181    builtin.obj clone.obj libomf.obj arrayop.obj irstate.obj \ 
    8282    glue.obj msc.obj ph.obj tk.obj s2ir.obj todt.obj e2ir.obj tocsym.obj \ 
    8383    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 
    8585 
    8686# from C/C++ compiler optimizer and back end 
    8787 
    8888OBJ8= go.obj gdag.obj gother.obj gflow.obj gloop.obj var.obj el.obj \ 
    8989    newman.obj glocal.obj os.obj nteh.obj evalu8.obj cgcs.obj \ 
    9090    rtlsym.obj html.obj cgelem.obj cgen.obj cgreg.obj out.obj \ 
    9191    blockopt.obj cgobj.obj cg.obj cgcv.obj type.obj dt.obj \ 
    9292    debug.obj code.obj cg87.obj cgsched.obj ee.obj csymbol.obj \ 
    9393    cgcod.obj cod1.obj cod2.obj cod3.obj cod4.obj cod5.obj outbuf.obj \ 
    9494    bcomplex.obj iasm.obj ptrntab.obj aa.obj ti_achar.obj md5.obj 
    9595 
    9696# from ROOT 
    9797 
    9898ROOTOBJS= lstring.obj array.obj gnuc.obj man.obj rmem.obj port.obj root.obj \ 
    9999    stringtable.obj dchar.obj response.obj async.obj speller.obj aav.obj 
    100100 
    101101OBJS= $(OBJ1) $(OBJ8) $(ROOTOBJS) 
    102102 
    103103SRCS= mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c utf.h \ 
    104104    utf.c entity.c identifier.c mtype.c expression.c optimize.c \ 
    105105    template.h template.c lexer.c declaration.c cast.c \ 
    106106    cond.h cond.c link.c aggregate.h staticassert.h parse.c statement.c \ 
    107107    constfold.c version.h version.c inifile.c iasm.c staticassert.c \ 
    108108    module.c scope.c dump.c init.h init.c attrib.h attrib.c opover.c \ 
    109109    eh.c toctype.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
    110110    access.c complex_t.h unialpha.c irstate.h irstate.c glue.c msc.c \ 
    111111    ph.c tk.c s2ir.c todt.c e2ir.c util.c toobj.c cppmangle.c \ 
    112     identifier.h parse.h objfile.h scope.h enum.h import.h \ 
     112    identifier.h parse.h scope.h enum.h import.h \ 
    113113    typinf.c tocvdebug.c toelfdebug.c mars.h module.h mtype.h dsymbol.h \ 
    114114    declaration.h lexer.h expression.h statement.h doc.h doc.c \ 
    115115    macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
    116116    delegatize.c toir.h toir.c interpret.c traits.c builtin.c \ 
    117117    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 
    119119 
    120120# From C++ compiler 
    121121 
    122122BACKSRC= $C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c \ 
    123123    $C\global.h $C\parser.h $C\code.h $C\type.h $C\dt.h $C\cgcv.h \ 
    124124    $C\el.h $C\iasm.h $C\rtlsym.h $C\html.h \ 
    125125    $C\bcomplex.c $C\blockopt.c $C\cg.c $C\cg87.c \ 
    126126    $C\cgcod.c $C\cgcs.c $C\cgcv.c $C\cgelem.c $C\cgen.c $C\cgobj.c \ 
    127127    $C\cgreg.c $C\var.c \ 
    128128    $C\cgsched.c $C\cod1.c $C\cod2.c $C\cod3.c $C\cod4.c $C\cod5.c \ 
    129129    $C\code.c $C\symbol.c $C\debug.c $C\dt.c $C\ee.c $C\el.c \ 
    130130    $C\evalu8.c $C\go.c $C\gflow.c $C\gdag.c \ 
    131131    $C\gother.c $C\glocal.c $C\gloop.c $C\html.c $C\newman.c \ 
    132132    $C\nteh.c $C\os.c $C\out.c $C\outbuf.c $C\ptrntab.c $C\rtlsym.c \ 
    133133    $C\type.c $C\melf.h $C\mach.h $C\bcomplex.h \ 
    134134    $C\cdeflnx.h $C\outbuf.h $C\token.h $C\tassert.h \ 
    135135    $C\elfobj.c $C\cv4.h $C\dwarf2.h $C\cpp.h $C\exh.h $C\go.h \ 
    136136    $C\dwarf.c $C\dwarf.h $C\cppman.c $C\machobj.c \ 
    137137    $C\strtold.c $C\aa.h $C\aa.c $C\tinfo.h $C\ti_achar.c \ 
    138138    $C\md5.h $C\md5.c \ 
     
    426426port.obj : $(ROOT)\port.c 
    427427    $(CC) -c $(CFLAGS) $(ROOT)\port.c 
    428428 
    429429root.obj : $(ROOT)\root.c 
    430430    $(CC) -c $(CFLAGS) $(ROOT)\root.c 
    431431 
    432432response.obj : $(ROOT)\response.c 
    433433    $(CC) -c $(CFLAGS) $(ROOT)\response.c 
    434434 
    435435speller.obj : $(ROOT)\speller.h $(ROOT)\speller.c 
    436436    $(CC) -c $(CFLAGS) $(ROOT)\speller.c 
    437437 
    438438stringtable.obj : $(ROOT)\stringtable.c 
    439439    $(CC) -c $(CFLAGS) $(ROOT)\stringtable.c 
    440440 
    441441 
    442442################# Source file dependencies ############### 
    443443 
    444444access.obj : $(TOTALH) enum.h aggregate.h init.h attrib.h access.c 
    445445aliasthis.obj : $(TOTALH) aliasthis.h aliasthis.c 
     446argtypes.obj : $(TOTALH) mtype.h argtypes.c 
    446447arrayop.obj : $(TOTALH) identifier.h declaration.h arrayop.c 
    447448attrib.obj : $(TOTALH) identifier.h declaration.h attrib.h attrib.c 
    448449builtin.obj : $(TOTALH) builtin.c 
    449450cast.obj : $(TOTALH) expression.h mtype.h cast.c 
    450451class.obj : $(TOTALH) enum.h class.c 
    451452clone.obj : $(TOTALH) clone.c 
    452453constfold.obj : $(TOTALH) expression.h constfold.c 
    453454cond.obj : $(TOTALH) identifier.h declaration.h cond.h cond.c 
    454455declaration.obj : $(TOTALH) identifier.h attrib.h declaration.h declaration.c 
    455456delegatize.obj : $(TOTALH) delegatize.c 
    456457doc.obj : $(TOTALH) doc.h doc.c 
    457458enum.obj : $(TOTALH) identifier.h enum.h enum.c 
    458459expression.obj : $(TOTALH) expression.h expression.c 
    459460func.obj : $(TOTALH) identifier.h attrib.h declaration.h func.c 
    460461hdrgen.obj : $(TOTALH) hdrgen.h hdrgen.c 
    461462id.obj : $(TOTALH) id.h id.c 
    462463identifier.obj : $(TOTALH) identifier.h identifier.c 
    463464import.obj : $(TOTALH) dsymbol.h import.h import.c 
    464465inifile.obj : $(TOTALH) inifile.c 
    465466init.obj : $(TOTALH) init.h init.c