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

Changeset 605

Show
Ignore:
Timestamp:
08/09/10 03:51:22 (14 years ago)
Author:
walter
Message:

bugzilla 4516 Regression(2.040): forward declaration of enum not supported

Files:

Legend:

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

    r596 r605  
    279279 * Generate a MOV to,from register instruction. 
    280280 * Smart enough to dump redundant register moves, and segment 
    281281 * register moves. 
    282282 */ 
    283283 
    284284code *genmovreg(code *c,unsigned to,unsigned from) 
    285285{ 
    286286#if DEBUG 
    287287        if (to > ES || from > ES) 
    288288                printf("genmovreg(c = %p, to = %d, from = %d)\n",c,to,from); 
    289289#endif 
    290290        assert(to <= ES && from <= ES); 
    291291        if (to != from) 
    292292        { 
    293293                if (to == ES) 
    294294                        c = genregs(c,0x8E,0,from); 
    295295                else if (from == ES) 
    296296                        c = genregs(c,0x8C,0,to); 
    297297                else 
    298298                        c = genregs(c,0x89,from,to); 
     299                if (I64) 
     300                        code_orrex(c, REX_W); 
    299301        } 
    300302        return c; 
    301303} 
    302304 
    303305/************************** 
    304306 * Generate a jump instruction. 
    305307 */ 
    306308 
    307309code *genjmp(code *c,unsigned op,unsigned fltarg,block *targ) 
    308310{   code cs; 
    309311    code *cj; 
    310312    code *cnop; 
    311313 
    312314    cs.Iop = op & 0xFF; 
    313315    cs.Iflags = 0; 
    314316    cs.Irex = 0; 
    315317    if (op != JMP)                      /* if not already long branch   */ 
    316318          cs.Iflags = CFjmp16;          /* assume long branch for op = 0x7x */ 
    317319    cs.IFL2 = fltarg;                   /* FLblock (or FLcode)          */ 
    318320    cs.IEV2.Vblock = targ;              /* target block (or code)       */ 
  • trunk/src/backend/cod1.c

    r596 r605  
    28042804                        {   /* Then symbol must be allocated on stack */ 
    28052805                            needframe = TRUE; 
    28062806                            break; 
    28072807                        } 
    28082808                    } 
    28092809                    else 
    28102810                    {   if (mfuncreg == 0)      /* if no registers left */ 
    28112811                        {   needframe = TRUE; 
    28122812                            break; 
    28132813                        } 
    28142814                    } 
    28152815                } 
    28162816            } 
    28172817        } 
    28182818  } 
    28192819#endif 
    28202820 
    28212821    retregs = regmask(e->Ety, tym1); 
    28222822 
    28232823    // If stack needs cleanup 
    2824     if (OTbinary(e->Eoper) && !typfunc(tym1) && 
     2824    if (OTbinary(e->Eoper) && 
     2825        (!typfunc(tym1) || I64) && 
    28252826      !(s && s->Sflags & SFLexit)) 
    28262827    { 
    28272828        if (tym1 == TYhfunc) 
    28282829        {   // Hidden parameter is popped off by the callee 
    28292830            c = genadjesp(c, -4); 
    28302831            stackpush -= 4; 
    28312832            if (numpara + numalign > 4) 
    28322833                c = genstackclean(c, numpara + numalign - 4, retregs); 
    28332834        } 
    28342835        else 
    28352836            c = genstackclean(c,numpara + numalign,retregs); 
    28362837    } 
    28372838    else 
    28382839    { 
    28392840        c = genadjesp(c,-numpara); 
    28402841        stackpush -= numpara; 
    28412842        if (numalign) 
    28422843            c = genstackclean(c,numalign,retregs); 
    28432844    } 
    28442845 
  • trunk/src/backend/cod3.c

    r596 r605  
    20032003        } 
    20042004        else if (xlocalsize == REGSIZE && (!I16 || b->BC == BCret)) 
    20052005        {   mfuncreg &= ~mask[regx]; 
    20062006            c = gen1(c,0x58 + regx);                    // POP regx 
    20072007        } 
    20082008        else if (xlocalsize) 
    20092009        { 
    20102010            c = genc2(c,0x81,modregrm(3,0,SP),xlocalsize);      // ADD SP,xlocalsize 
    20112011            if (I64) 
    20122012                code_orrex(c, REX_W); 
    20132013        } 
    20142014    } 
    20152015    if (b->BC == BCret || b->BC == BCretexp) 
    20162016    { 
    20172017Lret: 
    20182018        op = tyfarfunc(tym) ? 0xCA : 0xC2; 
    20192019        if (tym == TYhfunc) 
    20202020        { 
    20212021            c = genc2(c,0xC2,0,4);                      // RET 4 
    20222022        } 
    2023         else if (!typfunc(tym) || Poffset == 0
     2023        else if (!typfunc(tym) || Poffset == 0 || I64
    20242024        {   op++;                                       // to a regular RET 
    20252025            c = gen1(c,op); 
    20262026        } 
    20272027        else 
    20282028        {   // Stack is always aligned on register size boundary 
    20292029            Poffset = (Poffset + (REGSIZE - 1)) & ~(REGSIZE - 1); 
    20302030            c = genc2(c,op,0,Poffset);          // RET Poffset 
    20312031        } 
    20322032    } 
    20332033 
    20342034Lopt: 
    20352035    // If last instruction in ce is ADD SP,imm, and first instruction 
    20362036    // in c sets SP, we can dump the ADD. 
    20372037    cr = code_last(ce); 
    20382038    if (cr && c && !I64) 
    20392039    { 
    20402040        if (cr->Iop == 0x81 && cr->Irm == modregrm(3,0,SP))     // if ADD SP,imm 
    20412041        { 
    20422042            if ( 
    20432043                c->Iop == 0xC9 ||                                  // LEAVE 
  • trunk/src/backend/iasm.h

    r577 r605  
    1919// 
    2020// 
    2121 
    2222// This is for when the reg field of modregrm specifies which instruction it is 
    2323#define NUM_MASK        0x7 
    2424#define _0      (0x0 | _modrm)          // insure that some _modrm bit is set 
    2525#define _1      0x1                     // with _0 
    2626#define _2      0x2 
    2727#define _3      0x3 
    2828#define _4      0x4 
    2929#define _5      0x5 
    3030#define _6      0x6 
    3131#define _7      0x7 
    3232 
    3333#define _modrm  0x10 
    3434 
    3535#define _r      _modrm 
    3636#define _cb     _modrm 
    3737#define _cw     _modrm 
    3838#define _cd     _modrm 
     39#define _cq     _modrm 
    3940#define _cp     _modrm 
    4041#define _ib     0 
    4142#define _iw     0 
    4243#define _id     0 
    4344#define _rb     0 
    4445#define _rw     0 
    4546#define _rd     0 
    4647#define _16_bit 0x20 
    4748#define _32_bit 0x40 
    4849#define _64_bit 0x10000 
    4950#define _I386   0x80            // opcode is only for 386 and later 
    5051#define _16_bit_addr    0x100 
    5152#define _32_bit_addr    0x200 
    5253#define _fwait 0x400    // Add an FWAIT prior to the instruction opcode 
    5354#define _nfwait 0x800   // Do not add an FWAIT prior to the instruction 
    5455 
    5556#define MOD_MASK        0xF000  // Mod mask 
    5657#define _modsi          0x1000  // Instruction modifies SI 
    5758#define _moddx          0x2000  // Instruction modifies DX 
    5859#define _mod2           0x3000  // Instruction modifies second operand 
  • trunk/src/backend/ptrntab.c

    r577 r605  
    795795        { 0x38, _r|_modnot1,            _rm8,   _r8 }, 
    796796        { 0x39, _r|_16_bit|_modnot1,    _rm16,  _r16 }, 
    797797        { 0x39, _r|_32_bit|_modnot1,    _rm32,  _r32 }, 
    798798        { 0x3a, _r|_modnot1,            _r8,    _rm8 }, 
    799799        { 0x3b, _r|_16_bit|_modnot1,    _r16,   _rm16 }, 
    800800        { 0x3b, _r|_32_bit|_modnot1,    _r32,   _rm32 }, 
    801801        { ASM_END, 0, 0, 0 } 
    802802}; 
    803803PTRNTAB2  aptb2CMPS[] = /* CMPS */ { 
    804804        { 0xa6, _modsidi,               _m8,    _m8 }, 
    805805        { 0xa7, _modsidi,       _m16,   _m16 }, 
    806806        { 0xa7, _modsidi,       _m32,   _m32 }, 
    807807        { ASM_END, 0, 0, 0 } 
    808808}; 
    809809PTRNTAB2  aptb2CMPXCHG[] = /* CMPXCHG */ { 
    810810        { 0xfb0, _I386 | _cb|_mod2,     _rm8,   _r8 }, 
    811811                                                // This is really a 486 only 
    812812                                                // instruction 
    813813        { 0xfb1, _I386 | _cw | _16_bit|_mod2,   _rm16,  _r16 }, 
    814814        { 0xfb1, _I386 | _cd | _32_bit|_mod2,   _rm32,  _r32 }, 
     815        { 0xfb1, _I386 | _cq | _64_bit|_mod2,   _rm64,  _r64 }, 
    815816        { ASM_END, 0, 0, 0 } 
    816817}; 
    817818PTRNTAB2  aptb2DIV[] = /* DIV */ { 
    818819        { 0xf6, _6,                     _al,            _rm8 }, 
    819820        { 0xf7, _6 | _16_bit | _moddx,          _ax,            _rm16 }, 
    820821        { 0xf7, _6 | _32_bit | _moddx,          _eax,           _rm32 }, 
    821822        { 0xf6, _6 | _modax,                    _rm8,           0 }, 
    822823        { 0xf7, _6 | _16_bit | _modaxdx,                _rm16,          0 }, 
    823824        { 0xf7, _6 | _32_bit | _modaxdx,                _rm32,          0 }, 
    824825        { ASM_END, 0, 0, 0 } 
    825826}; 
    826827PTRNTAB2  aptb2ENTER[] = /* ENTER */ { 
    827828        { 0xc8, _iw|_ib,        _imm16, _imm8 }, 
    828829        { ASM_END, 0, 0, 0 } 
    829830}; 
    830831PTRNTAB2  aptb2IDIV[] = /* IDIV */ { 
    831832        { 0xf6, _7,                     _al,            _rm8 }, 
    832833        { 0xf7, _7|_16_bit|_moddx,              _ax,            _rm16 }, 
    833834        { 0xf7, _7|_32_bit|_moddx,              _eax,           _rm32 }, 
    834835        { 0xf6, _7 | _modax,                    _rm8,           0 }, 
     
    891892        { ASM_END, 0, 0, 0 } 
    892893}; 
    893894PTRNTAB2  aptb2LSL[] = /* LSL */ { 
    894895        { 0x0f03,       _r|_16_bit,                     _r16,   _rm16 }, 
    895896        { 0x0f03,       _r|_32_bit,                     _r32,   _rm32 }, 
    896897        { ASM_END, 0, 0, 0 } 
    897898}; 
    898899 
    899900PTRNTAB2 aptb2MOV[] = /* MOV */ { 
    900901#if 0 // Let pinholeopt() do this 
    901902        { 0xa0, 0,              _al,            _moffs8         }, 
    902903        { 0xa1, _16_bit,        _ax,            _moffs16        }, 
    903904        { 0xa1, _32_bit,        _eax,           _moffs32        }, 
    904905        { 0xa2, 0,              _moffs8,        _al             }, 
    905906        { 0xa3, _16_bit,        _moffs16,       _ax             }, 
    906907        { 0xa3, _32_bit,        _moffs32,       _eax            }, 
    907908#endif 
    908909        { 0x88, _r,             _rm8,           _r8             }, 
    909910        { 0x89, _r|_16_bit,     _rm16,          _r16            }, 
    910911        { 0x89, _r|_32_bit,     _rm32,          _r32            }, 
     912        { 0x89, _r|_64_bit,     _rm64,          _r64            }, 
    911913        { 0x8a, _r,             _r8,            _rm8            }, 
    912914        { 0x8b, _r|_16_bit,     _r16,           _rm16           }, 
    913915        { 0x8b, _r|_32_bit,     _r32,           _rm32           }, 
     916        { 0x8b, _r|_64_bit,     _r64,           _rm64           }, 
    914917        { 0x8c, _r,             _rm16,          _seg|_ds|_es| _ss | _fs | _gs | _cs }, 
    915918        { 0x8e, _r,             _seg|_ds|_es|_ss|_fs|_gs|_cs,   _rm16 }, 
    916919        { 0xb0, _rb,            _r8 | _plus_r,  _imm8           }, 
    917920        { 0xb8, _rw | _16_bit,  _r16 | _plus_r, _imm16          }, 
    918921        { 0xb8, _rd|_32_bit,    _r32 | _plus_r, _imm32          }, 
    919922        { 0xc6, _cb,            _rm8,           _imm8           }, 
    920923        { 0xc7, _cw|_16_bit,    _rm16,          _imm16          }, 
    921924        { 0xc7, _cd|_32_bit,    _rm32,          _imm32          }, 
    922925#if 0 // Let pinholeopt() do this 
    923926        { 0xc6, _cb,            _moffs8,        _imm8           }, 
    924927        { 0xc7, _cw|_16_bit,    _moffs16,       _imm16          }, 
    925928        { 0xc7, _cd|_32_bit,    _moffs32,       _imm32          }, 
    926929#endif 
    927930        { 0x0f20,       _r,     _r32,           _special | _crn }, 
    928931        { 0x0f22,       _r,     _special|_crn,  _r32            }, 
    929932        { 0x0f21,       _r,     _r32,           _special | _drn }, 
    930933        { 0x0f23,       _r,     _special|_drn,  _r32            }, 
    931934        { 0x0f24,       _r,     _r32,           _special | _trn }, 
    932935        { 0x0f26,       _r,     _special|_trn,  _r32            }, 
    933936        { ASM_END, 0, 0, 0 } 
  • trunk/src/backend/ty.h

    r579 r605  
    276276#else 
    277277/* Detect cpp function type (callee cleans up stack)    */ 
    278278#ifndef typfunc 
    279279#define typfunc(ty)     (tytab[(ty) & 0xFF] & TYFLcallstkc) 
    280280#endif 
    281281#endif 
    282282 
    283283/* Array to convert a type to its unsigned equivalent   */ 
    284284extern const tym_t tytouns[]; 
    285285#ifndef touns 
    286286#define touns(ty)       (tytouns[(ty) & 0xFF]) 
    287287#endif 
    288288 
    289289/* Determine if TYffunc or TYfpfunc (a far function) */ 
    290290#ifndef tyfarfunc 
    291291#define tyfarfunc(ty)   (tytab[(ty) & 0xFF] & TYFLfarfunc) 
    292292#endif 
    293293 
    294294// Determine if parameter can go in register for TYjfunc 
    295295#ifndef tyjparam 
    296 #define tyjparam(ty)    (tysize(ty) <= intsize && !tyfloating(ty) && tybasic(ty) != TYstruct && tybasic(ty) != TYarray) 
     296#define tyjparam(ty)    (tysize(ty) <= NPTRSIZE && !tyfloating(ty) && tybasic(ty) != TYstruct && tybasic(ty) != TYarray) 
    297297#endif 
    298298 
    299299/* Determine relaxed type       */ 
    300300#ifndef tyrelax 
    301301#define tyrelax(ty)     (_tyrelax[tybasic(ty)]) 
    302302#endif 
    303303 
    304304/* Array to give the 'relaxed' type for relaxed type checking   */ 
    305305extern unsigned char _tyrelax[]; 
    306306#define type_relax      (config.flags3 & CFG3relax)     // !=0 if relaxed type checking 
    307307#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS 
    308308#define type_semirelax  (config.flags3 & CFG3semirelax) // !=0 if semi-relaxed type checking 
    309309#else 
    310310#define type_semirelax  type_relax 
    311311#endif 
    312312 
    313313/* Determine functionally equivalent type       */ 
    314314extern unsigned char tyequiv[]; 
    315315 
    316316/* Give an ascii string for a type      */ 
  • trunk/src/freebsd.mak

    r599 r605  
    11 
     2C=backend 
     3TK=tk 
     4ROOT=root 
     5 
     6MODEL=-m32 
     7 
     8CC=g++ $(MODEL) 
     9 
     10#OPT=-g -g3 
     11#OPT=-O2 
     12 
     13#COV=-fprofile-arcs -ftest-coverage 
     14 
     15WARNINGS=-Wno-deprecated -Wstrict-aliasing 
     16 
     17#GFLAGS = $(WARNINGS) -D__near= -D__pascal= -fno-exceptions -g -DDEBUG=1 -DUNITTEST $(COV) 
     18GFLAGS = $(WARNINGS) -D__near= -D__pascal= -fno-exceptions -O2 
     19 
     20CFLAGS = $(GFLAGS) -I$(ROOT) -D__I86__=1 -DMARS=1 -DTARGET_FREEBSD=1 -D_DH 
     21MFLAGS = $(GFLAGS) -I$C -I$(TK) -D__I86__=1 -DMARS=1 -DTARGET_FREEBSD=1 -D_DH 
     22 
     23CH= $C/cc.h $C/global.h $C/parser.h $C/oper.h $C/code.h $C/type.h \ 
     24    $C/dt.h $C/cgcv.h $C/el.h $C/iasm.h 
     25TOTALH= 
     26 
     27DMD_OBJS = \ 
     28    access.o array.o attrib.o bcomplex.o bit.o blockopt.o \ 
     29    cast.o code.o cg.o cg87.o cgcod.o cgcs.o cgelem.o cgen.o \ 
     30    cgreg.o cgsched.o class.o cod1.o cod2.o cod3.o cod4.o cod5.o \ 
     31    constfold.o irstate.o dchar.o cond.o debug.o \ 
     32    declaration.o dsymbol.o dt.o dump.o e2ir.o ee.o eh.o el.o \ 
     33    dwarf.o enum.o evalu8.o expression.o func.o gdag.o gflow.o \ 
     34    glocal.o gloop.o glue.o gnuc.o go.o gother.o html.o iasm.o id.o \ 
     35    identifier.o impcnvtab.o import.o inifile.o init.o inline.o \ 
     36    lexer.o link.o lstring.o mangle.o mars.o rmem.o module.o msc.o mtype.o \ 
     37    nteh.o cppmangle.o opover.o optimize.o os.o out.o outbuf.o \ 
     38    parse.o ph.o ptrntab.o root.o rtlsym.o s2ir.o scope.o statement.o \ 
     39    stringtable.o struct.o csymbol.o template.o tk.o tocsym.o todt.o \ 
     40    type.o typinf.o util.o var.o version.o strtold.o utf.o staticassert.o \ 
     41    unialpha.o toobj.o toctype.o toelfdebug.o entity.o doc.o macro.o \ 
     42    hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 
     43    builtin.o clone.o aliasthis.o \ 
     44    man.o arrayop.o port.o response.o async.o json.o speller.o aav.o unittests.o \ 
     45    imphint.o \ 
     46    libelf.o elfobj.o 
     47 
     48SRC = win32.mak linux.mak osx.mak freebsd.mak solaris.mak \ 
     49    mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c \ 
     50    identifier.c mtype.c expression.c optimize.c template.h \ 
     51    template.c lexer.c declaration.c cast.c cond.h cond.c link.c \ 
     52    aggregate.h parse.c statement.c constfold.c version.h version.c \ 
     53    inifile.c iasm.c module.c scope.c dump.c init.h init.c attrib.h \ 
     54    attrib.c opover.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
     55    access.c complex_t.h irstate.h irstate.c glue.c msc.c ph.c tk.c \ 
     56    s2ir.c todt.c e2ir.c util.c identifier.h parse.h \ 
     57    scope.h enum.h import.h mars.h module.h mtype.h dsymbol.h \ 
     58    declaration.h lexer.h expression.h irstate.h statement.h eh.c \ 
     59    utf.h utf.c staticassert.h staticassert.c unialpha.c \ 
     60    typinf.c toobj.c toctype.c tocvdebug.c toelfdebug.c entity.c \ 
     61    doc.h doc.c macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
     62    delegatize.c toir.h toir.c interpret.c traits.c cppmangle.c \ 
     63    builtin.c clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
     64    aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c \ 
     65    $C/cdef.h $C/cc.h $C/oper.h $C/ty.h $C/optabgen.c \ 
     66    $C/global.h $C/parser.h $C/code.h $C/type.h $C/dt.h $C/cgcv.h \ 
     67    $C/el.h $C/iasm.h $C/rtlsym.h $C/html.h \ 
     68    $C/bcomplex.c $C/blockopt.c $C/cg.c $C/cg87.c \ 
     69    $C/cgcod.c $C/cgcs.c $C/cgcv.c $C/cgelem.c $C/cgen.c $C/cgobj.c \ 
     70    $C/cgreg.c $C/var.c $C/strtold.c \ 
     71    $C/cgsched.c $C/cod1.c $C/cod2.c $C/cod3.c $C/cod4.c $C/cod5.c \ 
     72    $C/code.c $C/symbol.c $C/debug.c $C/dt.c $C/ee.c $C/el.c \ 
     73    $C/evalu8.c $C/go.c $C/gflow.c $C/gdag.c \ 
     74    $C/gother.c $C/glocal.c $C/gloop.c $C/html.c $C/newman.c \ 
     75    $C/nteh.c $C/os.c $C/out.c $C/outbuf.c $C/ptrntab.c $C/rtlsym.c \ 
     76    $C/type.c $C/melf.h $C/mach.h $C/bcomplex.h \ 
     77    $C/cdeflnx.h $C/outbuf.h $C/token.h $C/tassert.h \ 
     78    $C/elfobj.c $C/cv4.h $C/dwarf2.h $C/cpp.h $C/exh.h $C/go.h \ 
     79    $C/dwarf.c $C/dwarf.h $C/aa.h $C/aa.c $C/tinfo.h $C/ti_achar.c \ 
     80    $C/machobj.c \ 
     81    $(TK)/filespec.h $(TK)/mem.h $(TK)/list.h $(TK)/vec.h \ 
     82    $(TK)/filespec.c $(TK)/mem.c $(TK)/vec.c $(TK)/list.c \ 
     83    $(ROOT)/dchar.h $(ROOT)/dchar.c $(ROOT)/lstring.h \ 
     84    $(ROOT)/lstring.c $(ROOT)/root.h $(ROOT)/root.c $(ROOT)/array.c \ 
     85    $(ROOT)/rmem.h $(ROOT)/rmem.c $(ROOT)/port.h $(ROOT)/port.c \ 
     86    $(ROOT)/gnuc.h $(ROOT)/gnuc.c $(ROOT)/man.c \ 
     87    $(ROOT)/stringtable.h $(ROOT)/stringtable.c \ 
     88    $(ROOT)/response.c $(ROOT)/async.h $(ROOT)/async.c \ 
     89    $(ROOT)/aav.h $(ROOT)/aav.c \ 
     90    $(ROOT)/speller.h $(ROOT)/speller.c 
     91 
     92 
     93all: dmd 
     94 
     95dmd: $(DMD_OBJS) 
     96    gcc $(MODEL) -lstdc++ -lpthread $(COV) $(DMD_OBJS) -o dmd 
     97 
     98clean: 
     99    rm -f $(DMD_OBJS) dmd optab.o id.o impcnvgen idgen id.c id.h \ 
     100    impcnvtab.c optabgen debtab.c optab.c cdxxx.c elxxx.c fltables.c \ 
     101    tytab.c core \ 
     102    *.cov *.gcda *.gcno 
     103 
     104######## optabgen generates some source 
     105 
     106optabgen: $C/optabgen.c $C/cc.h $C/oper.h 
     107    $(CC) $(MFLAGS) $< -o optabgen 
     108    ./optabgen 
     109 
     110optabgen_output = debtab.c optab.c cdxxx.c elxxx.c fltables.c tytab.c 
     111$(optabgen_output) : optabgen 
     112 
     113######## idgen generates some source 
     114 
     115idgen_output = id.h id.c 
     116$(idgen_output) : idgen 
     117 
     118idgen : idgen.c 
     119    $(CC) idgen.c -o idgen 
     120    ./idgen 
     121 
     122######### impcnvgen generates some source 
     123 
     124impcnvtab_output = impcnvtab.c 
     125$(impcnvtab_output) : impcnvgen 
     126 
     127impcnvgen : mtype.h impcnvgen.c 
     128    $(CC) $(CFLAGS) impcnvgen.c -o impcnvgen 
     129    ./impcnvgen 
     130 
     131######### 
     132 
     133$(DMD_OBJS) : $(idgen_output) $(optabgen_output) $(impcnvgen_output) 
     134 
     135aa.o: $C/aa.h $C/tinfo.h $C/aa.c 
     136    $(CC) -c $(MFLAGS) -I. $C/aa.c 
     137 
     138aav.o: $(ROOT)/aav.c 
     139    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     140 
     141access.o: access.c 
     142    $(CC) -c $(CFLAGS) $< 
     143 
     144aliasthis.o: aliasthis.c 
     145    $(CC) -c $(CFLAGS) $< 
     146 
     147array.o: $(ROOT)/array.c 
     148    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     149 
     150arrayop.o: arrayop.c 
     151    $(CC) -c $(CFLAGS) $< 
     152 
     153async.o: $(ROOT)/async.c 
     154    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     155 
     156attrib.o: attrib.c 
     157    $(CC) -c $(CFLAGS) $< 
     158 
     159bcomplex.o: $C/bcomplex.c 
     160    $(CC) -c $(MFLAGS) $< 
     161 
     162bit.o: expression.h bit.c 
     163    $(CC) -c -I$(ROOT) $(MFLAGS) bit.c 
     164 
     165blockopt.o: $C/blockopt.c 
     166    $(CC) -c $(MFLAGS) $C/blockopt.c 
     167 
     168builtin.o: builtin.c 
     169    $(CC) -c $(CFLAGS) $< 
     170 
     171cast.o: cast.c 
     172    $(CC) -c $(CFLAGS) $<  
     173 
     174cg.o: fltables.c $C/cg.c 
     175    $(CC) -c $(MFLAGS) -I. $C/cg.c 
     176 
     177cg87.o: $C/cg87.c 
     178    $(CC) -c $(MFLAGS) $< 
     179 
     180cgcod.o: $C/cgcod.c 
     181    $(CC) -c $(MFLAGS) -I. $< 
     182 
     183cgcs.o: $C/cgcs.c 
     184    $(CC) -c $(MFLAGS) $< 
     185 
     186cgcv.o: $C/cgcv.c 
     187    $(CC) -c $(MFLAGS) $< 
     188 
     189cgelem.o: $C/rtlsym.h $C/cgelem.c 
     190    $(CC) -c $(MFLAGS) -I. $C/cgelem.c 
     191 
     192cgen.o: $C/rtlsym.h $C/cgen.c 
     193    $(CC) -c $(MFLAGS) $C/cgen.c 
     194 
     195cgobj.o: $C/cgobj.c 
     196    $(CC) -c $(MFLAGS) $< 
     197 
     198cgreg.o: $C/cgreg.c 
     199    $(CC) -c $(MFLAGS) $< 
     200 
     201cgsched.o: $C/rtlsym.h $C/cgsched.c 
     202    $(CC) -c $(MFLAGS) $C/cgsched.c 
     203 
     204class.o: class.c 
     205    $(CC) -c $(CFLAGS) $< 
     206 
     207clone.o: clone.c 
     208    $(CC) -c $(CFLAGS) $< 
     209 
     210cod1.o: $C/rtlsym.h $C/cod1.c 
     211    $(CC) -c $(MFLAGS) $C/cod1.c 
     212 
     213cod2.o: $C/rtlsym.h $C/cod2.c 
     214    $(CC) -c $(MFLAGS) $C/cod2.c 
     215 
     216cod3.o: $C/rtlsym.h $C/cod3.c 
     217    $(CC) -c $(MFLAGS) $C/cod3.c 
     218 
     219cod4.o: $C/cod4.c 
     220    $(CC) -c $(MFLAGS) $< 
     221 
     222cod5.o: $C/cod5.c 
     223    $(CC) -c $(MFLAGS) $< 
     224 
     225code.o: $C/code.c 
     226    $(CC) -c $(MFLAGS) $< 
     227 
     228constfold.o: constfold.c 
     229    $(CC) -c $(CFLAGS) $< 
     230 
     231irstate.o: irstate.h irstate.c 
     232    $(CC) -c $(MFLAGS) -I$(ROOT) irstate.c 
     233 
     234csymbol.o : $C/symbol.c 
     235    $(CC) -c $(MFLAGS) $C/symbol.c -o csymbol.o 
     236 
     237dchar.o: $(ROOT)/dchar.c 
     238    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     239 
     240cond.o: cond.c 
     241    $(CC) -c $(CFLAGS) $< 
     242 
     243cppmangle.o: cppmangle.c 
     244    $(CC) -c $(CFLAGS) $< 
     245 
     246debug.o: $C/debug.c 
     247    $(CC) -c $(MFLAGS) -I. $< 
     248 
     249declaration.o: declaration.c 
     250    $(CC) -c $(CFLAGS) $< 
     251 
     252delegatize.o: delegatize.c 
     253    $(CC) -c $(CFLAGS) $< 
     254 
     255doc.o: doc.c 
     256    $(CC) -c $(CFLAGS) $< 
     257 
     258dsymbol.o: dsymbol.c 
     259    $(CC) -c $(CFLAGS) $< 
     260 
     261dt.o: $C/dt.h $C/dt.c 
     262    $(CC) -c $(MFLAGS) $C/dt.c 
     263 
     264dump.o: dump.c 
     265    $(CC) -c $(CFLAGS) $< 
     266 
     267dwarf.o: $C/dwarf.h $C/dwarf.c 
     268    $(CC) -c $(MFLAGS) -I. $C/dwarf.c 
     269 
     270e2ir.o: $C/rtlsym.h expression.h toir.h e2ir.c 
     271    $(CC) -c -I$(ROOT) $(MFLAGS) e2ir.c 
     272 
     273ee.o: $C/ee.c 
     274    $(CC) -c $(MFLAGS) $< 
     275 
     276eh.o : $C/cc.h $C/code.h $C/type.h $C/dt.h eh.c 
     277    $(CC) -c $(MFLAGS) eh.c 
     278 
     279el.o: $C/rtlsym.h $C/el.h $C/el.c 
     280    $(CC) -c $(MFLAGS) $C/el.c 
     281 
     282elfobj.o: $C/elfobj.c 
     283    $(CC) -c $(MFLAGS) $< 
     284 
     285entity.o: entity.c 
     286    $(CC) -c $(CFLAGS) $< 
     287 
     288enum.o: enum.c 
     289    $(CC) -c $(CFLAGS) $< 
     290 
     291evalu8.o: $C/evalu8.c 
     292    $(CC) -c $(MFLAGS) $< 
     293 
     294expression.o: expression.c 
     295    $(CC) -c $(CFLAGS) $< 
     296 
     297func.o: func.c 
     298    $(CC) -c $(CFLAGS) $< 
     299 
     300gdag.o: $C/gdag.c 
     301    $(CC) -c $(MFLAGS) $< 
     302 
     303gflow.o: $C/gflow.c 
     304    $(CC) -c $(MFLAGS) $< 
     305 
     306#globals.o: globals.c 
     307#   $(CC) -c $(CFLAGS) $< 
     308 
     309glocal.o: $C/rtlsym.h $C/glocal.c 
     310    $(CC) -c $(MFLAGS) $C/glocal.c 
     311 
     312gloop.o: $C/gloop.c 
     313    $(CC) -c $(MFLAGS) $< 
     314 
     315glue.o: $(CH) $(TOTALH) $C/rtlsym.h mars.h module.h glue.c 
     316    $(CC) -c $(MFLAGS) -I$(ROOT) glue.c 
     317 
     318gnuc.o: $(ROOT)/gnuc.h $(ROOT)/gnuc.c 
     319    $(CC) -c $(GFLAGS) $(ROOT)/gnuc.c 
     320 
     321go.o: $C/go.c 
     322    $(CC) -c $(MFLAGS) $< 
     323 
     324gother.o: $C/gother.c 
     325    $(CC) -c $(MFLAGS) $< 
     326 
     327hdrgen.o: hdrgen.c 
     328    $(CC) -c $(CFLAGS) $< 
     329 
     330html.o: $(CH) $(TOTALH) $C/html.h $C/html.c 
     331    $(CC) -c -I$(ROOT) $(MFLAGS) $C/html.c 
     332 
     333iasm.o : $(CH) $(TOTALH) $C/iasm.h iasm.c 
     334    $(CC) -c $(MFLAGS) -I$(ROOT) iasm.c 
     335 
     336id.o : id.h id.c 
     337    $(CC) -c $(CFLAGS) id.c 
     338 
     339identifier.o: identifier.c 
     340    $(CC) -c $(CFLAGS) $< 
     341 
     342impcnvtab.o: mtype.h impcnvtab.c 
     343    $(CC) -c $(CFLAGS) -I$(ROOT) impcnvtab.c 
     344 
     345imphint.o: imphint.c 
     346    $(CC) -c $(CFLAGS) $< 
     347 
     348import.o: import.c 
     349    $(CC) -c $(CFLAGS) $< 
     350 
     351inifile.o: inifile.c 
     352    $(CC) -c $(CFLAGS) $< 
     353 
     354init.o: init.c 
     355    $(CC) -c $(CFLAGS) $< 
     356 
     357inline.o: inline.c 
     358    $(CC) -c $(CFLAGS) $< 
     359 
     360interpret.o: interpret.c 
     361    $(CC) -c $(CFLAGS) $< 
     362 
     363json.o: json.c 
     364    $(CC) -c $(CFLAGS) $< 
     365 
     366lexer.o: lexer.c 
     367    $(CC) -c $(CFLAGS) $< 
     368 
     369libelf.o: libelf.c $C/melf.h 
     370    $(CC) -c $(CFLAGS) -I$C $< 
     371 
     372libmach.o: libmach.c $C/mach.h 
     373    $(CC) -c $(CFLAGS) -I$C $< 
     374 
     375link.o: link.c 
     376    $(CC) -c $(CFLAGS) $< 
     377 
     378lstring.o: $(ROOT)/lstring.c 
     379    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     380 
     381machobj.o: $C/machobj.c 
     382    $(CC) -c $(MFLAGS) $< 
     383 
     384macro.o: macro.c 
     385    $(CC) -c $(CFLAGS) $< 
     386 
     387man.o: $(ROOT)/man.c 
     388    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     389 
     390mangle.o: mangle.c 
     391    $(CC) -c $(CFLAGS) $< 
     392 
     393mars.o: mars.c 
     394    $(CC) -c $(CFLAGS) $< 
     395 
     396rmem.o: $(ROOT)/rmem.c 
     397    $(CC) -c $(GFLAGS) -I$(ROOT) $(ROOT)/rmem.c 
     398     
     399module.o: $(TOTALH) $C/html.h module.c 
     400    $(CC) -c $(CFLAGS) -I$C module.c 
     401 
     402msc.o: $(CH) mars.h msc.c 
     403    $(CC) -c $(MFLAGS) msc.c 
     404 
     405mtype.o: mtype.c 
     406    $(CC) -c $(CFLAGS) $< 
     407 
     408nteh.o: $C/rtlsym.h $C/nteh.c 
     409    $(CC) -c $(MFLAGS) $C/nteh.c 
     410 
     411opover.o: opover.c 
     412    $(CC) -c $(CFLAGS) $< 
     413 
     414optimize.o: optimize.c 
     415    $(CC) -c $(CFLAGS) $< 
     416 
     417os.o: $C/os.c 
     418    $(CC) -c $(MFLAGS) $< 
     419 
     420out.o: $C/out.c 
     421    $(CC) -c $(MFLAGS) $< 
     422 
     423outbuf.o : $C/outbuf.h $C/outbuf.c 
     424    $(CC) -c $(MFLAGS) $C/outbuf.c 
     425 
     426parse.o: parse.c 
     427    $(CC) -c $(CFLAGS) $< 
     428 
     429ph.o: ph.c 
     430    $(CC) -c $(MFLAGS) $< 
     431 
     432port.o: $(ROOT)/port.c 
     433    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     434 
     435ptrntab.o: $C/iasm.h $C/ptrntab.c 
     436    $(CC) -c $(MFLAGS) $C/ptrntab.c 
     437 
     438response.o: $(ROOT)/response.c 
     439    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     440 
     441root.o: $(ROOT)/root.c 
     442    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     443 
     444rtlsym.o: $C/rtlsym.h $C/rtlsym.c 
     445    $(CC) -c $(MFLAGS) $C/rtlsym.c 
     446 
     447s2ir.o : $C/rtlsym.h statement.h s2ir.c 
     448    $(CC) -c -I$(ROOT) $(MFLAGS) s2ir.c 
     449 
     450scope.o: scope.c 
     451    $(CC) -c $(CFLAGS) $< 
     452 
     453speller.o: $(ROOT)/speller.c 
     454    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     455 
     456statement.o: statement.c 
     457    $(CC) -c $(CFLAGS) $< 
     458 
     459staticassert.o: staticassert.h staticassert.c 
     460    $(CC) -c $(CFLAGS) staticassert.c 
     461 
     462stringtable.o: $(ROOT)/stringtable.c 
     463    $(CC) -c $(GFLAGS) -I$(ROOT) $< 
     464 
     465strtold.o: $C/strtold.c 
     466    gcc $(MODEL) -c $C/strtold.c 
     467 
     468struct.o: struct.c 
     469    $(CC) -c $(CFLAGS) $< 
     470 
     471template.o: template.c 
     472    $(CC) -c $(CFLAGS) $< 
     473 
     474ti_achar.o: $C/tinfo.h $C/ti_achar.c 
     475    $(CC) -c $(MFLAGS) -I. $C/ti_achar.c 
     476 
     477tk.o: tk.c 
     478    $(CC) -c $(MFLAGS) tk.c 
     479 
     480tocsym.o: $(CH) $(TOTALH) mars.h module.h tocsym.c 
     481    $(CC) -c $(MFLAGS) -I$(ROOT) tocsym.c 
     482 
     483toctype.o: $(CH) $(TOTALH) $C/rtlsym.h mars.h module.h toctype.c 
     484    $(CC) -c $(MFLAGS) -I$(ROOT) toctype.c 
     485 
     486todt.o : mtype.h expression.h $C/dt.h todt.c 
     487    $(CC) -c -I$(ROOT) $(MFLAGS) todt.c 
     488 
     489toelfdebug.o: $(CH) $(TOTALH) mars.h toelfdebug.c 
     490    $(CC) -c $(MFLAGS) -I$(ROOT) toelfdebug.c 
     491 
     492toir.o: $C/rtlsym.h expression.h toir.h toir.c 
     493    $(CC) -c -I$(ROOT) $(MFLAGS) toir.c 
     494 
     495toobj.o: $(CH) $(TOTALH) mars.h module.h toobj.c 
     496    $(CC) -c $(MFLAGS) -I$(ROOT) toobj.c 
     497 
     498traits.o: $(TOTALH) traits.c 
     499    $(CC) -c $(CFLAGS) $< 
     500 
     501type.o: $C/type.c 
     502    $(CC) -c $(MFLAGS) $C/type.c 
     503 
     504typinf.o: $(CH) $(TOTALH) mars.h module.h mtype.h typinf.c 
     505    $(CC) -c $(MFLAGS) -I$(ROOT) typinf.c 
     506 
     507util.o: util.c 
     508    $(CC) -c $(MFLAGS) $< 
     509 
     510utf.o: utf.h utf.c 
     511    $(CC) -c $(CFLAGS) utf.c 
     512 
     513unialpha.o: unialpha.c 
     514    $(CC) -c $(CFLAGS) $< 
     515 
     516unittests.o: unittests.c 
     517    $(CC) -c $(CFLAGS) $< 
     518 
     519var.o: $C/var.c optab.c 
     520    $(CC) -c $(MFLAGS) -I. $C/var.c 
     521 
     522version.o: version.c 
     523    $(CC) -c $(CFLAGS) $< 
     524 
     525###################################################### 
     526 
     527gcov: 
     528    gcov access.c 
     529    gcov aliasthis.c 
     530    gcov arrayop.c 
     531    gcov attrib.c 
     532    gcov bit.c 
     533    gcov builtin.c 
     534    gcov cast.c 
     535    gcov class.c 
     536    gcov clone.c 
     537    gcov cond.c 
     538    gcov constfold.c 
     539    gcov declaration.c 
     540    gcov delegatize.c 
     541    gcov doc.c 
     542    gcov dsymbol.c 
     543    gcov dump.c 
     544    gcov e2ir.c 
     545    gcov eh.c 
     546    gcov entity.c 
     547    gcov enum.c 
     548    gcov expression.c 
     549    gcov func.c 
     550    gcov glue.c 
     551    gcov iasm.c 
     552    gcov identifier.c 
     553    gcov imphint.c 
     554    gcov import.c 
     555    gcov inifile.c 
     556    gcov init.c 
     557    gcov inline.c 
     558    gcov interpret.c 
     559    gcov irstate.c 
     560    gcov json.c 
     561    gcov lexer.c 
     562    gcov libelf.c 
     563    gcov link.c 
     564    gcov macro.c 
     565    gcov mangle.c 
     566    gcov mars.c 
     567    gcov module.c 
     568    gcov msc.c 
     569    gcov mtype.c 
     570    gcov opover.c 
     571    gcov optimize.c 
     572    gcov parse.c 
     573    gcov ph.c 
     574    gcov scope.c 
     575    gcov statement.c 
     576    gcov staticassert.c 
     577    gcov s2ir.c 
     578    gcov struct.c 
     579    gcov template.c 
     580    gcov tk.c 
     581    gcov tocsym.c 
     582    gcov todt.c 
     583    gcov toobj.c 
     584    gcov toctype.c 
     585    gcov toelfdebug.c 
     586    gcov typinf.c 
     587    gcov unialpha.c 
     588    gcov utf.c 
     589    gcov util.c 
     590    gcov version.c 
     591 
     592#   gcov hdrgen.c 
     593#   gcov tocvdebug.c 
     594 
     595###################################################### 
     596 
     597zip: 
     598    -rm -f dmdsrc.zip 
     599    zip dmdsrc $(SRC) 
  • trunk/src/glue.c

    r592 r605  
    790790 
    791791    // Determine register assignments 
    792792    if (pi) 
    793793    { 
    794794        if (global.params.isX86_64) 
    795795        { 
    796796            // Order of assignment of pointer or integer parameters 
    797797            static const unsigned char argregs[6] = { DI,SI,DX,CX,R8,R9 }; 
    798798            int r = 0; 
    799799            int xmmcnt = XMM0; 
    800800 
    801801            for (int i = 0; i < pi; i++) 
    802802            {   Symbol *sp = params[i]; 
    803803                tym_t ty = tybasic(sp->Stype->Tty); 
    804804                // BUG: doesn't work for structs 
    805805                if (r < sizeof(argregs)/sizeof(argregs[0])) 
    806806                { 
    807807                    if (type_jparam(sp->Stype)) 
    808808                    { 
    809809                        sp->Sclass = SCfastpar; 
    810                         sp->Spreg = r
     810                        sp->Spreg = argregs[r]
    811811                        sp->Sfl = FLauto; 
    812812                        ++r; 
    813813                    } 
    814814                } 
    815815                if (xmmcnt < XMM7) 
    816816                { 
    817817                    if (tyfloating(ty) && tysize(ty) <= 8) 
    818818                    { 
    819819                        sp->Sclass = SCfastpar; 
    820820                        sp->Spreg = xmmcnt; 
    821821                        sp->Sfl = FLauto; 
    822822                        ++xmmcnt; 
    823823                    } 
    824824                } 
    825825            } 
    826826        } 
    827827        else 
    828828        { 
    829829            // First parameter goes in register 
    830830            Symbol *sp = params[0]; 
  • trunk/src/iasm.c

    r596 r605  
    534534{ 
    535535    if (tok_value == toknum) 
    536536        asm_token();                    // scan past token 
    537537    else 
    538538        /* When we run out of tokens, asmtok is NULL. 
    539539         * But when this happens when a ';' was hit. 
    540540         */ 
    541541        asmerr(errnum, asmtok ? asmtok->toChars() : ";"); 
    542542} 
    543543 
    544544 
    545545/******************************* 
    546546 */ 
    547547 
    548548STATIC PTRNTAB asm_classify(OP *pop, OPND *popnd1, OPND *popnd2, OPND *popnd3, 
    549549        unsigned *pusNumops) 
    550550{ 
    551551        unsigned usNumops; 
    552552        unsigned usActual; 
    553553        PTRNTAB ptbRet = { NULL }; 
    554         opflag_t usFlags1 = 0 ; 
    555         opflag_t usFlags2 = 0; 
    556         opflag_t usFlags3 = 0; 
    557         PTRNTAB1 *pptb1; 
    558         PTRNTAB2 *pptb2; 
    559         PTRNTAB3 *pptb3; 
     554        opflag_t opflags1 = 0 ; 
     555        opflag_t opflags2 = 0; 
     556        opflag_t opflags3 = 0; 
    560557        char    bFake = FALSE; 
    561558 
    562559        unsigned char   bMatch1, bMatch2, bMatch3, bRetry = FALSE; 
    563560 
    564561        // How many arguments are there?  the parser is strictly left to right 
    565562        // so this should work. 
    566563 
    567564        if (!popnd1) 
    568565            usNumops = 0; 
    569566        else 
    570567        { 
    571             popnd1->usFlags = usFlags1 = asm_determine_operand_flags(popnd1); 
     568            popnd1->usFlags = opflags1 = asm_determine_operand_flags(popnd1); 
    572569            if (!popnd2) 
    573570                usNumops = 1; 
    574571            else 
    575572            { 
    576                 popnd2->usFlags = usFlags2 = asm_determine_operand_flags(popnd2); 
     573                popnd2->usFlags = opflags2 = asm_determine_operand_flags(popnd2); 
    577574                if (!popnd3) 
    578575                    usNumops = 2; 
    579576                else 
    580577                { 
    581                     popnd3->usFlags = usFlags3 = asm_determine_operand_flags(popnd3); 
     578                    popnd3->usFlags = opflags3 = asm_determine_operand_flags(popnd3); 
    582579                    usNumops = 3; 
    583580                } 
    584581            } 
    585582        } 
    586583 
    587584        // Now check to insure that the number of operands is correct 
    588585        usActual = (pop->usNumops & ITSIZE); 
    589586        if (usActual != usNumops && asmstate.ucItype != ITopt && 
    590587            asmstate.ucItype != ITfloat) 
    591588        { 
    592589PARAM_ERROR: 
    593590                asmerr(EM_nops_expected, usActual, asm_opstr(pop), usNumops); 
    594591        } 
    595592        if (usActual < usNumops) 
    596593            *pusNumops = usActual; 
    597594        else 
    598595            *pusNumops = usNumops; 
    599596// 
    600597//      The number of arguments matches, now check to find the opcode 
    601598//      in the associated opcode table 
    602599// 
    603600RETRY: 
    604601        //printf("usActual = %d\n", usActual); 
    605602        switch (usActual) 
    606603        { 
    607604            case 0: 
    608605                ptbRet = pop->ptb ; 
    609606                goto RETURN_IT; 
    610607 
    611608            case 1: 
    612                 //printf("usFlags1 = "); asm_output_flags(usFlags1); printf("\n"); 
    613                 for (pptb1 = pop->ptb.pptb1; pptb1->usOpcode != ASM_END; 
    614                         pptb1++) 
     609            {   //printf("opflags1 = "); asm_output_flags(opflags1); printf("\n"); 
     610                PTRNTAB1 *table1; 
     611                for (table1 = pop->ptb.pptb1; table1->usOpcode != ASM_END; 
     612                        table1++) 
    615613                { 
    616                         //printf("table    = "); asm_output_flags(pptb1->usOp1); printf("\n"); 
    617                         bMatch1 = asm_match_flags(usFlags1, pptb1->usOp1); 
     614                        //printf("table    = "); asm_output_flags(table1->usOp1); printf("\n"); 
     615                        bMatch1 = asm_match_flags(opflags1, table1->usOp1); 
    618616                        //printf("bMatch1 = x%x\n", bMatch1); 
    619617                        if (bMatch1) 
    620                         {   if (pptb1->usOpcode == 0x68 && 
     618                        {   if (table1->usOpcode == 0x68 && 
    621619                                !I16 && 
    622                                 pptb1->usOp1 == _imm16 
     620                                table1->usOp1 == _imm16 
    623621                              ) 
    624622                                // Don't match PUSH imm16 in 32 bit code 
    625623                                continue; 
    626624                            break; 
    627625                        } 
    628626                        if ((asmstate.ucItype == ITimmed) && 
    629                             asm_match_flags(usFlags1, 
     627                            asm_match_flags(opflags1, 
    630628                                CONSTRUCT_FLAGS(_8 | _16 | _32, _imm, _normal, 
    631629                                                 0)) && 
    632                                 popnd1->disp == pptb1->usFlags) 
     630                                popnd1->disp == table1->usFlags) 
    633631                            break; 
    634632                        if ((asmstate.ucItype == ITopt || 
    635633                             asmstate.ucItype == ITfloat) && 
    636634                            !usNumops && 
    637                             !pptb1->usOp1) 
     635                            !table1->usOp1) 
    638636                        { 
    639637                            if (usNumops > 1) 
    640638                                goto PARAM_ERROR; 
    641639                            break; 
    642640                        } 
    643641                } 
    644                 if (pptb1->usOpcode == ASM_END) 
     642                if (table1->usOpcode == ASM_END) 
    645643                { 
    646644#ifdef DEBUG 
    647645                    if (debuga) 
    648646                    {   printf("\t%s\t", asm_opstr(pop)); 
    649647                        if (popnd1) 
    650648                                asm_output_popnd(popnd1); 
    651649                        if (popnd2) { 
    652650                                printf(","); 
    653651                                asm_output_popnd(popnd2); 
    654652                        } 
    655653                        if (popnd3) { 
    656654                                printf(","); 
    657655                                asm_output_popnd(popnd3); 
    658656                        } 
    659657                        printf("\n"); 
    660658 
    661659                        printf("OPCODE mism = "); 
    662660                        if (popnd1) 
    663661                            asm_output_flags(popnd1->usFlags); 
    664662                        else 
    665663                            printf("NONE"); 
    666664                        printf("\n"); 
    667665                    } 
    668666#endif 
    669667TYPE_SIZE_ERROR: 
    670668                        if (popnd1 && ASM_GET_aopty(popnd1->usFlags) != _reg) 
    671669                        { 
    672                             usFlags1 = popnd1->usFlags |= _anysize; 
     670                            opflags1 = popnd1->usFlags |= _anysize; 
    673671                            if (asmstate.ucItype == ITjump) 
    674672                            { 
    675673                                if (bRetry && popnd1->s && !popnd1->s->isLabel()) 
    676674                                { 
    677675                                    asmerr(EM_label_expected, popnd1->s->toChars()); 
    678676                                } 
    679677 
    680678                                popnd1->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 
    681679                                        _fanysize); 
    682680                            } 
    683681                        } 
    684682                        if (popnd2 && ASM_GET_aopty(popnd2->usFlags) != _reg) { 
    685                             usFlags2 = popnd2->usFlags |= (_anysize); 
     683                            opflags2 = popnd2->usFlags |= (_anysize); 
    686684                            if (asmstate.ucItype == ITjump) 
    687685                                popnd2->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 
    688686                                        _fanysize); 
    689687                        } 
    690688                        if (popnd3 && ASM_GET_aopty(popnd3->usFlags) != _reg) { 
    691                             usFlags3 = popnd3->usFlags |= (_anysize); 
     689                            opflags3 = popnd3->usFlags |= (_anysize); 
    692690                            if (asmstate.ucItype == ITjump) 
    693691                                popnd3->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 
    694692                                        _fanysize); 
    695693                        } 
    696694                        if (bRetry) 
    697695                        { 
    698696                            asmerr(EM_bad_op, asm_opstr(pop));  // illegal type/size of operands 
    699697                        } 
    700698                        bRetry = TRUE; 
    701699                        goto RETRY; 
    702700 
    703701                } 
    704                 ptbRet.pptb1 = pptb1; 
     702                ptbRet.pptb1 = table1; 
    705703                goto RETURN_IT; 
    706  
     704            } 
    707705            case 2: 
    708                 //printf("usFlags1 = "); asm_output_flags(usFlags1); printf(" "); 
    709                 //printf("usFlags2 = "); asm_output_flags(usFlags2); printf("\n"); 
    710                 for (pptb2 = pop->ptb.pptb2; 
    711                      pptb2->usOpcode != ASM_END; 
    712                      pptb2++) 
     706            {   //printf("opflags1 = "); asm_output_flags(opflags1); printf(" "); 
     707                //printf("opflags2 = "); asm_output_flags(opflags2); printf("\n"); 
     708                PTRNTAB2 *table2; 
     709                for (table2 = pop->ptb.pptb2; 
     710                     table2->usOpcode != ASM_END; 
     711                     table2++) 
    713712                { 
    714                         //printf("table1   = "); asm_output_flags(pptb2->usOp1); printf(" "); 
    715                         //printf("table2   = "); asm_output_flags(pptb2->usOp2); printf("\n"); 
    716                         bMatch1 = asm_match_flags(usFlags1, pptb2->usOp1); 
    717                         bMatch2 = asm_match_flags(usFlags2, pptb2->usOp2); 
     713                        //printf("table1   = "); asm_output_flags(table2->usOp1); printf(" "); 
     714                        //printf("table2   = "); asm_output_flags(table2->usOp2); printf("\n"); 
     715                        bMatch1 = asm_match_flags(opflags1, table2->usOp1); 
     716                        bMatch2 = asm_match_flags(opflags2, table2->usOp2); 
    718717                        //printf("match1 = %d, match2 = %d\n",bMatch1,bMatch2); 
    719718                        if (bMatch1 && bMatch2) { 
    720719 
    721720                            //printf("match\n"); 
    722721 
    723 // OK, if they both match and the first op in the table is not AL 
    724 // or size of 8 and the second is immediate 8, 
    725 // then check to see if the constant 
    726 // is a signed 8 bit constant.  If so, then do not match, otherwise match 
    727 /
     722                            /* If they both match and the first op in the table is not AL 
     723                             * or size of 8 and the second is immediate 8, 
     724                             * then check to see if the constant 
     725                             * is a signed 8 bit constant.  If so, then do not match, otherwise match 
     726                             *
    728727                            if (!bRetry && 
    729                                 !((ASM_GET_uSizemask(pptb2->usOp1) & _8) || 
    730                                   (ASM_GET_uRegmask(pptb2->usOp1) & _al)) && 
    731                                 (ASM_GET_aopty(pptb2->usOp2) == _imm) && 
    732                                 (ASM_GET_uSizemask(pptb2->usOp2) & _8)) 
     728                                !((ASM_GET_uSizemask(table2->usOp1) & _8) || 
     729                                  (ASM_GET_uRegmask(table2->usOp1) & _al)) && 
     730                                (ASM_GET_aopty(table2->usOp2) == _imm) && 
     731                                (ASM_GET_uSizemask(table2->usOp2) & _8)) 
    733732                            { 
    734733 
    735734                                if (popnd2->disp <= SCHAR_MAX) 
    736735                                    break; 
    737736                                else 
    738737                                    bFake = TRUE; 
    739738                            } 
    740739                            else 
    741740                                break; 
    742741                        } 
    743742                        if (asmstate.ucItype == ITopt || 
    744743                            asmstate.ucItype == ITfloat) 
    745744                        { 
    746745                                switch (usNumops) 
    747746                                { 
    748747                                    case 0: 
    749                                         if (!pptb2->usOp1) 
     748                                        if (!table2->usOp1) 
    750749                                            goto Lfound2; 
    751750                                        break; 
    752751                                    case 1: 
    753                                         if (bMatch1 && !pptb2->usOp2) 
     752                                        if (bMatch1 && !table2->usOp2) 
    754753                                            goto Lfound2; 
    755754                                        break; 
    756755                                    case 2: 
    757756                                        break; 
    758757                                    default: 
    759758                                        goto PARAM_ERROR; 
    760759                                } 
    761760                        } 
    762761#if 0 
    763762                        if (asmstate.ucItype == ITshift && 
    764                             !pptb2->usOp2 && 
     763                            !table2->usOp2 && 
    765764                            bMatch1 && popnd2->disp == 1 && 
    766                             asm_match_flags(usFlags2, 
     765                            asm_match_flags(opflags2, 
    767766                                CONSTRUCT_FLAGS(_8|_16|_32, _imm,_normal,0)) 
    768767                          ) 
    769768                            break; 
    770769#endif 
    771770                } 
    772771            Lfound2: 
    773                 if (pptb2->usOpcode == ASM_END) 
     772                if (table2->usOpcode == ASM_END) 
    774773                { 
    775774#ifdef DEBUG 
    776775                    if (debuga) 
    777776                    {   printf("\t%s\t", asm_opstr(pop)); 
    778777                        if (popnd1) 
    779778                                asm_output_popnd(popnd1); 
    780779                        if (popnd2) { 
    781780                                printf(","); 
    782781                                asm_output_popnd(popnd2); 
    783782                        } 
    784783                        if (popnd3) { 
    785784                                printf(","); 
    786785                                asm_output_popnd(popnd3); 
    787786                        } 
    788787                        printf("\n"); 
    789788 
    790789                        printf("OPCODE mismatch = "); 
    791790                        if (popnd1) 
    792791                            asm_output_flags(popnd1->usFlags); 
    793792                        else 
    794793                            printf("NONE"); 
    795794                        printf( " Op2 = "); 
    796795                        if (popnd2) 
    797796                            asm_output_flags(popnd2->usFlags); 
    798797                        else 
    799798                            printf("NONE"); 
    800799                        printf("\n"); 
    801800                    } 
    802801#endif 
    803802                    goto TYPE_SIZE_ERROR; 
    804803                } 
    805                 ptbRet.pptb2 = pptb2; 
     804                ptbRet.pptb2 = table2; 
    806805                goto RETURN_IT; 
    807         case 3: 
    808                 for (pptb3 = pop->ptb.pptb3; 
    809                      pptb3->usOpcode != ASM_END; 
    810                      pptb3++) 
     806            } 
     807            case 3: 
     808            { 
     809                PTRNTAB3 *table3; 
     810                for (table3 = pop->ptb.pptb3; 
     811                     table3->usOpcode != ASM_END; 
     812                     table3++) 
    811813                { 
    812                         bMatch1 = asm_match_flags(usFlags1, pptb3->usOp1); 
    813                         bMatch2 = asm_match_flags(usFlags2, pptb3->usOp2); 
    814                         bMatch3 = asm_match_flags(usFlags3, pptb3->usOp3); 
     814                        bMatch1 = asm_match_flags(opflags1, table3->usOp1); 
     815                        bMatch2 = asm_match_flags(opflags2, table3->usOp2); 
     816                        bMatch3 = asm_match_flags(opflags3, table3->usOp3); 
    815817                        if (bMatch1 && bMatch2 && bMatch3) 
    816818                            goto Lfound3; 
    817819                        if (asmstate.ucItype == ITopt) 
    818820                        { 
    819821                            switch (usNumops) 
    820822                            { 
    821823                                case 0: 
    822                                         if (!pptb3->usOp1) 
     824                                        if (!table3->usOp1) 
    823825                                            goto Lfound3; 
    824826                                        break; 
    825827                                case 1: 
    826                                         if (bMatch1 && !pptb3->usOp2) 
     828                                        if (bMatch1 && !table3->usOp2) 
    827829                                            goto Lfound3; 
    828830                                        break; 
    829831                                case 2: 
    830                                         if (bMatch1 && bMatch2 && !pptb3->usOp3) 
     832                                        if (bMatch1 && bMatch2 && !table3->usOp3) 
    831833                                            goto Lfound3; 
    832834                                        break; 
    833835                                case 3: 
    834836                                        break; 
    835837                                default: 
    836838                                        goto PARAM_ERROR; 
    837839                            } 
    838840                        } 
    839841                } 
    840842            Lfound3: 
    841                 if (pptb3->usOpcode == ASM_END) 
     843                if (table3->usOpcode == ASM_END) 
    842844                { 
    843845#ifdef DEBUG 
    844846                    if (debuga) 
    845847                    {   printf("\t%s\t", asm_opstr(pop)); 
    846848                        if (popnd1) 
    847849                                asm_output_popnd(popnd1); 
    848850                        if (popnd2) { 
    849851                                printf(","); 
    850852                                asm_output_popnd(popnd2); 
    851853                        } 
    852854                        if (popnd3) { 
    853855                                printf(","); 
    854856                                asm_output_popnd(popnd3); 
    855857                        } 
    856858                        printf("\n"); 
    857859 
    858860                        printf("OPCODE mismatch = "); 
    859861                        if (popnd1) 
    860862                            asm_output_flags(popnd1->usFlags); 
    861863                        else 
    862864                            printf("NONE"); 
    863865                        printf( " Op2 = "); 
    864866                        if (popnd2) 
    865867                            asm_output_flags(popnd2->usFlags); 
    866868                        else 
    867869                            printf("NONE"); 
    868870                        if (popnd3) 
    869871                            asm_output_flags(popnd3->usFlags); 
    870872                        printf("\n"); 
    871873                    } 
    872874#endif 
    873875                    goto TYPE_SIZE_ERROR; 
    874876                } 
    875                 ptbRet.pptb3 = pptb3; 
     877                ptbRet.pptb3 = table3; 
    876878                goto RETURN_IT; 
     879            } 
    877880        } 
    878881RETURN_IT: 
    879882        if (bRetry && !bFake) 
    880883        { 
    881884            asmerr(EM_bad_op, asm_opstr(pop)); 
    882885        } 
    883886        return ptbRet; 
    884887} 
    885888 
    886889/******************************* 
    887890 */ 
    888891 
    889892STATIC opflag_t asm_determine_float_flags(OPND *popnd) 
    890893{ 
    891894    //printf("asm_determine_float_flags()\n"); 
    892895 
    893896    opflag_t us, usFloat; 
    894897 
    895898    // Insure that if it is a register, that it is not a normal processor 
    896899    // register. 
     
    969972        if (asmstate.ucItype == ITfloat) 
    970973            return asm_determine_float_flags(popnd); 
    971974 
    972975        // If just a register 
    973976        if (popnd->base && !popnd->s && !popnd->disp && !popnd->real) 
    974977                return popnd->base->ty; 
    975978#if DEBUG 
    976979        if (debuga) 
    977980            printf("popnd->base = %s\n, popnd->pregDisp1 = %p\n", popnd->base ? popnd->base->regstr : "NONE", popnd->pregDisp1); 
    978981#endif 
    979982        ps = popnd->s; 
    980983        Declaration *ds = ps ? ps->isDeclaration() : NULL; 
    981984        if (ds && ds->storage_class & STClazy) 
    982985            sz = _anysize; 
    983986        else 
    984987            sz = asm_type_size((ds && ds->storage_class & (STCout | STCref)) ? popnd->ptype->pointerTo() : popnd->ptype); 
    985988        if (popnd->pregDisp1 && !popnd->base) 
    986989        { 
    987990            if (ps && ps->isLabel() && sz == _anysize) 
    988991                sz = I16 ? _16 : _32; 
    989             return (popnd->pregDisp1->ty & _r32
     992            return (popnd->pregDisp1->ty & (_r32 | _r64)
    990993                ? CONSTRUCT_FLAGS(sz, _m, _addr32, 0) 
    991994                : CONSTRUCT_FLAGS(sz, _m, _addr16, 0); 
    992995        } 
    993996        else if (ps) 
    994997        { 
    995998                if (popnd->bOffset || popnd->bSeg || ps == asmstate.psLocalsize) 
    996999                    return I16 
    9971000                        ? CONSTRUCT_FLAGS(_16, _imm, _normal, 0) 
    9981001                        : CONSTRUCT_FLAGS(_32, _imm, _normal, 0); 
    9991002 
    10001003                if (ps->isLabel()) 
    10011004                { 
    10021005                    switch (popnd->ajt) 
    10031006                    { 
    10041007                        case ASM_JUMPTYPE_UNSPECIFIED: 
    10051008                            if (ps == asmstate.psDollar) 
    10061009                            { 
    10071010                                if (popnd->disp >= CHAR_MIN && 
    10081011                                    popnd->disp <= CHAR_MAX) 
    10091012                                    us = CONSTRUCT_FLAGS(_8, _rel, _flbl,0); 
     
    15711574                        pc->IFL2 = FLconst; 
    15721575                        break; 
    15731576                } 
    15741577                if (aoptyTable2 == _m || 
    15751578                    aoptyTable2 == _rel || 
    15761579                    // If not MMX register (_mm) or XMM register (_xmm) 
    15771580                    (amodTable1 == _rspecial && !(uRegmaskTable1 & (0x08 | 0x10)) && !uSizemaskTable1) || 
    15781581                    aoptyTable2 == _rm || 
    15791582                    (popnd1->usFlags == _r32 && popnd2->usFlags == _xmm) || 
    15801583                    (popnd1->usFlags == _r32 && popnd2->usFlags == _mm)) 
    15811584                { 
    15821585#if 0 
    15831586printf("test4 %d,%d,%d,%d\n", 
    15841587(aoptyTable2 == _m), 
    15851588(aoptyTable2 == _rel), 
    15861589(amodTable1 == _rspecial && !(uRegmaskTable1 & (0x08 | 0x10))), 
    15871590(aoptyTable2 == _rm) 
    15881591); 
    15891592printf("usOpcode = %x\n", usOpcode); 
    15901593#endif 
     1594                        if (popnd1->usFlags == _r64) 
     1595                            pc->Irex |= REX_W; 
    15911596                        if (ptb.pptb0->usOpcode == 0x0F7E ||    // MOVD _rm32,_mm 
    15921597                            ptb.pptb0->usOpcode == 0x660F7E     // MOVD _rm32,_xmm 
    15931598                           ) 
    15941599                        { 
    15951600                            asm_make_modrm_byte( 
    15961601#ifdef DEBUG 
    15971602                                auchOpcode, &usIdx, 
    15981603#endif 
    15991604                                pc, 
    16001605                                ptb.pptb1->usFlags, 
    16011606                                popnd1, popnd2); 
    16021607                        } 
    16031608                        else 
    16041609                        { 
    16051610                            asm_make_modrm_byte( 
    16061611#ifdef DEBUG 
    16071612                                auchOpcode, &usIdx, 
    16081613#endif 
    16091614                                pc, 
    16101615                                ptb.pptb1->usFlags, 
    16111616                                popnd2, popnd1); 
    16121617                        } 
    16131618                        popndTmp = popnd1; 
    16141619                        aoptyTmp = aoptyTable1; 
    16151620                        uSizemaskTmp = uSizemaskTable1; 
    16161621                } 
    16171622                else 
    16181623                { 
     1624                        if (popnd2->usFlags == _r64) 
     1625                            pc->Irex |= REX_W; 
     1626 
    16191627                        if (((aoptyTable1 == _reg || aoptyTable1 == _float) && 
    16201628                             amodTable1 == _normal && 
    16211629                             (uRegmaskTable1 & _rplus_r))) 
    16221630                        { 
    16231631                            unsigned reg = popnd1->base->val; 
    16241632                            if (reg & 8) 
    16251633                            {   reg &= 7; 
    16261634                                pc->Irex |= REX_B; 
    16271635                                assert(I64); 
    16281636                            } 
    16291637                            if (asmstate.ucItype == ITfloat) 
    16301638                                pc->Irm += reg; 
    16311639                            else 
    16321640                                pc->Iop += reg; 
    16331641#ifdef DEBUG 
    16341642                            auchOpcode[usIdx-1] += reg; 
    16351643#endif 
    16361644                        } 
    16371645                        else 
    16381646                        if (((aoptyTable2 == _reg || aoptyTable2 == _float) && 
     
    18221830 
    18231831 
    18241832/******************************* 
    18251833 */ 
    18261834 
    18271835STATIC void asmerr(int errnum, ...) 
    18281836{   const char *format; 
    18291837 
    18301838    const char *p = asmstate.loc.toChars(); 
    18311839    if (*p) 
    18321840        printf("%s: ", p); 
    18331841 
    18341842    format = asmerrmsgs[errnum]; 
    18351843    va_list ap; 
    18361844    va_start(ap, errnum); 
    18371845    vprintf(format, ap); 
    18381846    va_end(ap); 
    18391847 
    18401848    printf("\n"); 
    18411849    fflush(stdout); 
    1842  
     1850halt(); 
    18431851    longjmp(asmstate.env,1); 
    18441852} 
    18451853 
    18461854/******************************* 
    18471855 */ 
    18481856 
    18491857STATIC void asmerr(const char *format, ...) 
    18501858{ 
    18511859    const char *p = asmstate.loc.toChars(); 
    18521860    if (*p) 
    18531861        printf("%s: ", p); 
    18541862 
    18551863    va_list ap; 
    18561864    va_start(ap, format); 
    18571865    vprintf(format, ap); 
    18581866    va_end(ap); 
    18591867 
    18601868    printf("\n"); 
    18611869    fflush(stdout); 
    18621870 
     
    23732381                r1r2 = Y(popnd->pregDisp1->val); 
    23742382            switch (r1r2) 
    23752383            { 
    23762384                case X(_BX,_SI):        rm = 0; break; 
    23772385                case X(_BX,_DI):        rm = 1; break; 
    23782386                case Y(_BX):    rm = 7; break; 
    23792387 
    23802388                case X(_BP,_SI):        rm = 2; break; 
    23812389                case X(_BP,_DI):        rm = 3; break; 
    23822390                case Y(_BP):    rm = 6; bDisp = TRUE;   break; 
    23832391 
    23842392                case X(_SI,_BX):        rm = 0; break; 
    23852393                case X(_SI,_BP):        rm = 2; break; 
    23862394                case Y(_SI):    rm = 4; break; 
    23872395 
    23882396                case X(_DI,_BX):        rm = 1; break; 
    23892397                case X(_DI,_BP):        rm = 3; break; 
    23902398                case Y(_DI):    rm = 5; break; 
    23912399 
    23922400                default: 
    2393                     asmerr(EM_bad_addr_mode);   // illegal addressing mode 
     2401                    asmerr("bad 16 bit index address mode"); 
    23942402            } 
    23952403            #undef X 
    23962404            #undef Y 
    23972405        } 
    23982406        mrmb.modregrm.rm = rm; 
    23992407 
    24002408#ifdef DEBUG 
    24012409        if (debuga) 
    24022410            printf("This is an mod = %d, popnd->s =%p, popnd->disp = %ld\n", 
    24032411               mrmb.modregrm.mod, s, popnd->disp); 
    24042412#endif 
    24052413            if (!s || (!mrmb.modregrm.mod && popnd->disp)) 
    24062414            { 
    24072415                if ((!popnd->disp && !bDisp) || 
    24082416                    !popnd->pregDisp1) 
    24092417                    mrmb.modregrm.mod = 0x0; 
    24102418                else 
    24112419                if (popnd->disp >= CHAR_MIN && 
    24122420                    popnd->disp <= SCHAR_MAX) 
    24132421                    mrmb.modregrm.mod = 0x1; 
     
    28922900                case _fn32: 
    28932901                case _flbl: 
    28942902                    return(TRUE); 
    28952903                default: 
    28962904                    return(FALSE); 
    28972905            } 
    28982906        case _rseg: 
    28992907        case _rspecial: 
    29002908            return(FALSE); 
    29012909        default: 
    29022910            assert(0); 
    29032911            return 0; 
    29042912    } 
    29052913} 
    29062914 
    29072915#ifdef DEBUG 
    29082916 
    29092917/******************************* 
    29102918 */ 
    29112919 
    2912 STATIC void asm_output_flags(opflag_t usFlags) 
    2913 { 
    2914         ASM_OPERAND_TYPE    aopty = ASM_GET_aopty(usFlags); 
    2915         ASM_MODIFIERS       amod = ASM_GET_amod(usFlags); 
    2916         unsigned            uRegmask = ASM_GET_uRegmask(usFlags); 
    2917         unsigned            uSizemask = ASM_GET_uSizemask(usFlags); 
     2920STATIC void asm_output_flags(opflag_t opflags) 
     2921{ 
     2922        ASM_OPERAND_TYPE    aopty = ASM_GET_aopty(opflags); 
     2923        ASM_MODIFIERS       amod = ASM_GET_amod(opflags); 
     2924        unsigned            uRegmask = ASM_GET_uRegmask(opflags); 
     2925        unsigned            uSizemask = ASM_GET_uSizemask(opflags); 
    29182926 
    29192927        if (uSizemask == _anysize) 
    29202928            printf("_anysize "); 
    29212929        else if (uSizemask == 0) 
    29222930            printf("0        "); 
    29232931        else 
    29242932        { 
    29252933            if (uSizemask & _8) 
    29262934                printf("_8  "); 
    29272935            if (uSizemask & _16) 
    29282936                printf("_16 "); 
    29292937            if (uSizemask & _32) 
    29302938                printf("_32 "); 
    29312939            if (uSizemask & _48) 
    29322940                printf("_48 "); 
    29332941            if (uSizemask & _64) 
    29342942                printf("_64 "); 
    29352943        } 
    29362944 
    29372945        printf("_"); 
  • trunk/src/mtype.c

    r604 r605  
    63196319} 
    63206320 
    63216321 
    63226322Expression *TypeEnum::defaultInit(Loc loc) 
    63236323{ 
    63246324#if LOGDEFAULTINIT 
    63256325    printf("TypeEnum::defaultInit() '%s'\n", toChars()); 
    63266326#endif 
    63276327    // Initialize to first member of enum 
    63286328    //printf("%s\n", sym->defaultval->type->toChars()); 
    63296329    if (!sym->defaultval) 
    63306330    { 
    63316331        error(loc, "forward reference of %s.init", toChars()); 
    63326332        return new ErrorExp(); 
    63336333    } 
    63346334    return sym->defaultval; 
    63356335} 
    63366336 
    63376337int TypeEnum::isZeroInit(Loc loc) 
    63386338{ 
     6339    if (!sym->defaultval && sym->scope) 
     6340    {   // Enum is forward referenced. We need to resolve the whole thing. 
     6341        sym->semantic(NULL); 
     6342    } 
    63396343    if (!sym->defaultval) 
    63406344    { 
    63416345#ifdef DEBUG 
    63426346        printf("3: "); 
    63436347#endif 
    63446348        error(loc, "enum %s is forward referenced", sym->toChars()); 
    63456349        return 0; 
    63466350    } 
    63476351    return sym->defaultval->isBool(FALSE); 
    63486352} 
    63496353 
    63506354int TypeEnum::hasPointers() 
    63516355{ 
    63526356    return toBasetype()->hasPointers(); 
    63536357} 
    63546358 
    63556359/***************************** TypeTypedef *****************************/ 
    63566360 
    63576361TypeTypedef::TypeTypedef(TypedefDeclaration *sym) 
    63586362        : Type(Ttypedef) 
  • trunk/src/win32.mak

    r473 r605  
    11#_ win32.mak 
    2 # Copyright (C) 1999-2009 by Digital Mars, http://www.digitalmars.com 
     2# Copyright (C) 1999-2010 by Digital Mars, http://www.digitalmars.com 
    33# Written by Walter Bright 
    44# All Rights Reserved 
    55# Build dmd with Digital Mars C++ compiler 
    66 
    77D= 
    88DMDSVN=\svnproj\dmd\trunk\src 
    99#DMDSVN=\svnproj\dmd\branches\dmd-1.x\src 
    1010SCROOT=$D\dm 
    1111INCLUDE=$(SCROOT)\include 
    1212CC=\dm\bin\dmc 
    1313LIBNT=$(SCROOT)\lib 
    1414SNN=$(SCROOT)\lib\snn 
    1515DIR=\dmd2 
    1616CP=cp 
    1717 
    1818C=backend 
    1919TK=tk 
    2020ROOT=root 
    2121 
    2222MAKE=make -fwin32.mak C=$C TK=$(TK) ROOT=$(ROOT) 
     
    478478statement.obj : $(TOTALH) statement.h statement.c 
    479479staticassert.obj : $(TOTALH) staticassert.h staticassert.c 
    480480struct.obj : $(TOTALH) identifier.h enum.h struct.c 
    481481traits.obj : $(TOTALH) traits.c 
    482482dsymbol.obj : $(TOTALH) identifier.h dsymbol.h dsymbol.c 
    483483mtype.obj : $(TOTALH) mtype.h mtype.c 
    484484#typinf.obj : $(TOTALH) mtype.h typinf.c 
    485485utf.obj : utf.h utf.c 
    486486template.obj : $(TOTALH) template.h template.c 
    487487version.obj : $(TOTALH) identifier.h dsymbol.h cond.h version.h version.c 
    488488 
    489489################### Utilities ################ 
    490490 
    491491clean: 
    492492    del *.obj 
    493493    del total.sym 
    494494    del msgs.h msgs.c 
    495495    del elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c 
    496496    del impcnvtab.c 
    497497 
    498 zip : detab $(MAKEFILES) 
     498zip : detab tolf $(MAKEFILES) 
    499499    del dmdsrc.zip 
    500500    zip32 dmdsrc $(MAKEFILES) 
    501501    zip32 dmdsrc $(SRCS) 
    502502    zip32 dmdsrc $(BACKSRC) 
    503503    zip32 dmdsrc $(TKSRC) 
    504504    zip32 dmdsrc $(ROOTSRC) 
    505505 
    506506################### Detab ################ 
    507507 
    508508detab: 
    509509    detab $(SRCS) $(ROOTSRC) $(TKSRC) $(BACKSRC) 
     510 
     511tolf: 
     512    tolf $(SRCS) $(ROOTSRC) $(TKSRC) $(BACKSRC) $(MAKEFILES) 
    510513 
    511514################### Install ################ 
    512515 
    513516install: detab install2 
    514517 
    515518install2: 
    516519    copy dmd.exe $(DIR)\windows\bin\  
    517520    copy phobos\phobos.lib $(DIR)\windows\lib  
    518521    $(CP) $(SRCS) $(DIR)\src\dmd\  
    519522    $(CP) $(ROOTSRC) $(DIR)\src\dmd\root\  
    520523    $(CP) $(TKSRC) $(DIR)\src\dmd\tk\   
    521524    $(CP) $(BACKSRC) $(DIR)\src\dmd\backend\   
    522525    $(CP) $(MAKEFILES) $(DIR)\src\dmd\   
    523526    copy gpl.txt $(DIR)\src\dmd\  
    524527    copy readme.txt $(DIR)\src\dmd\  
    525528    copy artistic.txt $(DIR)\src\dmd\  
    526529    copy backendlicense.txt $(DIR)\src\dmd\  
    527530 
    528531################### Write to SVN ################ 
    529532 
    530 svn:    detab svn2 
     533svn:    detab tolf svn2 
    531534 
    532535svn2: 
    533536    $(CP) $(SRCS) $(DMDSVN)\  
    534537    $(CP) $(ROOTSRC) $(DMDSVN)\root\  
    535538    $(CP) $(TKSRC) $(DMDSVN)\tk\   
    536539    $(CP) $(BACKSRC) $(DMDSVN)\backend\   
    537540    $(CP) $(MAKEFILES) $(DMDSVN)\   
    538541    copy gpl.txt $(DMDSVN)\  
    539542    copy readme.txt $(DMDSVN)\  
    540543    copy artistic.txt $(DMDSVN)\  
    541544    copy backendlicense.txt $(DMDSVN)\  
    542545 
    543546###################################