Changeset 415

Show
Ignore:
Timestamp:
03/12/07 20:50:31 (1 year ago)
Author:
Gregor
Message:

MERGE: DMD 1.009

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmdfe/constfold.c

    r414 r415  
    458458    n2 = e2->toInteger(); 
    459459    if (n2 == 0) 
    460     {   error("divide by 0"); 
     460    {   e2->error("divide by 0"); 
    461461        e2 = new IntegerExp(0, 1, e2->type); 
    462462        n2 = 1; 
     
    521521    n2 = e2->toInteger(); 
    522522    if (n2 == 0) 
    523     {   error("divide by 0"); 
     523    {   e2->error("divide by 0"); 
    524524        e2 = new IntegerExp(0, 1, e2->type); 
    525525        n2 = 1; 
     
    10301030    Loc loc = e1->loc; 
    10311031 
    1032     //printf("Index(e1->type = %p)\n", e1->type); 
     1032    //printf("Index(e1 = %s)\n", e1->toChars()); 
     1033    assert(e1->type); 
    10331034    if (e1->op == TOKstring && e2->op == TOKint64) 
    10341035    {   StringExp *es1 = (StringExp *)e1; 
     
    10671068 
    10681069    if (i >= length) 
    1069     {   error("array index %ju is out of bounds [0 .. %ju]", i, length); 
     1070    {   e2->error("array index %ju is out of bounds %s[0 .. %ju]", i, e1->toChars(), length); 
    10701071    } 
    10711072    else if (e1->op == TOKarrayliteral && !e1->checkSideEffect(2)) 
     
    11451146{   Expression *e = EXP_CANT_INTERPRET; 
    11461147    Loc loc = e1->loc; 
     1148    Type *t; 
    11471149 
    11481150    //printf("Cat(e1 = %s, e2 = %s)\n", e1->toChars(), e2->toChars()); 
     
    11851187    return e; 
    11861188    } 
    1187  
    1188     if (e1->op == TOKstring && e2->op == TOKstring) 
     1189    else if (e1->op == TOKstring && e2->op == TOKstring) 
    11891190    { 
    11901191    // Concatenate the strings 
     
    13201321    else if (e1->op == TOKnull && e2->op == TOKstring) 
    13211322    { 
     1323    t = e1->type; 
    13221324    e = e2; 
    13231325    goto L1; 
     
    13251327    else if (e1->op == TOKstring && e2->op == TOKnull) 
    13261328    {   e = e1; 
     1329    t = e2->type; 
    13271330      L1: 
     1331    Type *tb = t->toBasetype(); 
     1332    if (tb->ty == Tarray && tb->next->equals(e->type)) 
     1333    {   Expressions *expressions = new Expressions(); 
     1334        expressions->push(e); 
     1335        e = new ArrayLiteralExp(loc, expressions); 
     1336        e->type = t; 
     1337    } 
    13281338    if (!e->type->equals(type)) 
    13291339    {   StringExp *se = (StringExp *)e->copy(); 
  • branches/dmdfe/declaration.c

    r361 r415  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2006 by Digital Mars 
     3// Copyright (c) 1999-2007 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    149149 
    150150    return tupletype; 
     151} 
     152 
     153int TupleDeclaration::needThis() 
     154{ 
     155    //printf("TupleDeclaration::needThis(%s)\n", toChars()); 
     156    for (size_t i = 0; i < objects->dim; i++) 
     157    {   Object *o = (Object *)objects->data[i]; 
     158    if (o->dyncast() == DYNCAST_EXPRESSION) 
     159    {   Expression *e = (Expression *)o; 
     160        if (e->op == TOKdsymbol) 
     161        {   DsymbolExp *ve = (DsymbolExp *)e; 
     162        Declaration *d = ve->s->isDeclaration(); 
     163        if (d && d->needThis()) 
     164        { 
     165            return 1; 
     166        } 
     167        } 
     168    } 
     169    } 
     170    return 0; 
    151171} 
    152172 
     
    967987int VarDeclaration::needThis() 
    968988{ 
     989    //printf("VarDeclaration::needThis(%s, x%x)\n", toChars(), storage_class); 
    969990    return storage_class & STCfield; 
    970991} 
  • branches/dmdfe/declaration.h

    r414 r415  
    131131    char *kind(); 
    132132    Type *getType(); 
     133    int needThis(); 
    133134 
    134135    TupleDeclaration *isTupleDeclaration() { return this; } 
     
    461462    FuncAliasDeclaration *isFuncAliasDeclaration() { return this; } 
    462463    char *kind(); 
     464    Symbol *toSymbol(); 
    463465}; 
    464466 
  • branches/dmdfe/expression.c

    r414 r415  
    11551155        } 
    11561156        case Tchar: 
    1157         if (isprint(v) && v != '\\') 
     1157        if (v == '\'') 
     1158            buf->writestring("'\\''"); 
     1159        else if (isprint(v) && v != '\\') 
    11581160            buf->printf("'%c'", (int)v); 
    11591161        else 
     
    18301832    TupleDeclaration *tup = s->isTupleDeclaration(); 
    18311833    if (tup) 
    1832     {   Expressions *exps = new Expressions(); 
    1833  
    1834     exps->reserve(tup->objects->dim); 
    1835     for (size_t i = 0; i < tup->objects->dim; i++) 
    1836     {   Object *o = (Object *)tup->objects->data[i]; 
    1837         if (o->dyncast() != DYNCAST_EXPRESSION) 
    1838         { 
    1839         error("%s is not an expression", o->toChars()); 
    1840         } 
    1841         else 
    1842         { 
    1843         Expression *e = (Expression *)o; 
    1844         e = e->syntaxCopy(); 
    1845         exps->push(e); 
    1846         } 
    1847     } 
    1848     e = new TupleExp(loc, exps); 
     1834    { 
     1835    e = new TupleExp(loc, tup); 
    18491836    e = e->semantic(sc); 
    18501837    return e; 
     
    27572744    else 
    27582745    type = newtype->semantic(loc, sc); 
     2746    newtype = type;     // in case type gets cast to something else 
    27592747    tb = type->toBasetype(); 
    27602748    //printf("tb: %s, deco = %s\n", tb->toChars(), tb->deco); 
     
    32763264    this->exps = exps; 
    32773265    this->type = NULL; 
     3266} 
     3267 
     3268 
     3269TupleExp::TupleExp(Loc loc, TupleDeclaration *tup) 
     3270    : Expression(loc, TOKtuple, sizeof(TupleExp)) 
     3271{ 
     3272    exps = new Expressions(); 
     3273    type = NULL; 
     3274 
     3275    exps->reserve(tup->objects->dim); 
     3276    for (size_t i = 0; i < tup->objects->dim; i++) 
     3277    {   Object *o = (Object *)tup->objects->data[i]; 
     3278    if (o->dyncast() == DYNCAST_EXPRESSION) 
     3279    { 
     3280        Expression *e = (Expression *)o; 
     3281        e = e->syntaxCopy(); 
     3282        exps->push(e); 
     3283    } 
     3284    else if (o->dyncast() == DYNCAST_DSYMBOL) 
     3285    { 
     3286        Dsymbol *s = (Dsymbol *)o; 
     3287        Expression *e = new DsymbolExp(loc, s); 
     3288        exps->push(e); 
     3289    } 
     3290    else 
     3291    { 
     3292        error("%s is not an expression", o->toChars()); 
     3293    } 
     3294    } 
    32783295} 
    32793296 
     
    47214738    s2 = s->search(loc, id, 0); 
    47224739    if (!s2) 
    4723     {   error("template identifier %s is not a member of %s", id->toChars(), s->ident->toChars()); 
     4740    {   error("template identifier %s is not a member of %s %s", id->toChars(), s->kind(), s->ident->toChars()); 
    47244741    goto Lerr; 
    47254742    } 
  • branches/dmdfe/expression.h

    r414 r415  
    1919struct Type; 
    2020struct Scope; 
     21struct TupleDeclaration; 
    2122struct VarDeclaration; 
    2223struct FuncDeclaration; 
     
    309310 
    310311    TupleExp(Loc loc, Expressions *exps); 
     312    TupleExp(Loc loc, TupleDeclaration *tup); 
    311313    Expression *syntaxCopy(); 
    312314    int equals(Object *o); 
     
    12151217#define EXP_BREAK_INTERPRET ((Expression *)3) 
    12161218#define EXP_GOTO_INTERPRET  ((Expression *)4) 
     1219#define EXP_VOID_INTERPRET  ((Expression *)5) 
    12171220 
    12181221Expression *expType(Type *type, Expression *e); 
  • branches/dmdfe/init.c

    r361 r415  
    360360{   Expressions *elements; 
    361361 
     362    //printf("ArrayInitializer::toExpression()\n"); 
     363    //static int i; if (++i == 2) halt(); 
    362364    elements = new Expressions(); 
    363365    for (size_t i = 0; i < value.dim; i++) 
  • branches/dmdfe/interpret.c

    r414 r415  
    7676    TypeFunction *tf = (TypeFunction *)tb; 
    7777    Type *tret = tf->next->toBasetype(); 
    78     if (tf->varargs || tret->ty == Tvoid
     78    if (tf->varargs /*|| tret->ty == Tvoid*/
    7979    {   cantInterpret = 1; 
    8080    return NULL; 
     
    8888        {   cantInterpret = 1; 
    8989        return NULL; 
    90         } 
    91     } 
    92     } 
    93  
    94     /* Save the values of the local variables used 
    95      */ 
    96     Expressions valueSaves; 
    97     if (istate) 
    98     { 
    99     valueSaves.setDim(istate->vars.dim); 
    100     for (size_t i = 0; i < istate->vars.dim; i++) 
    101     {   VarDeclaration *v = (VarDeclaration *)istate->vars.data[i]; 
    102         if (v) 
    103         {   valueSaves.data[i] = v->value; 
    104         v->value = NULL; 
    10590        } 
    10691    } 
     
    174159    } 
    175160 
     161    /* Save the values of the local variables used 
     162     */ 
     163    Expressions valueSaves; 
     164    if (istate) 
     165    { 
     166    //printf("saving state...\n"); 
     167    valueSaves.setDim(istate->vars.dim); 
     168    for (size_t i = 0; i < istate->vars.dim; i++) 
     169    {   VarDeclaration *v = (VarDeclaration *)istate->vars.data[i]; 
     170        if (v) 
     171        { 
     172        //printf("\tsaving [%d] %s = %s\n", i, v->toChars(), v->value->toChars()); 
     173        valueSaves.data[i] = v->value; 
     174        v->value = NULL; 
     175        } 
     176    } 
     177    } 
     178 
    176179    Expression *e = NULL; 
    177180 
     
    253256{ 
    254257#if LOG 
    255     printf("ExpStatement::interpret()\n"); 
     258    printf("ExpStatement::interpret(%s)\n", exp ? exp->toChars() : ""); 
    256259#endif 
    257260    START() 
     
    286289    } 
    287290    } 
     291#if LOG 
     292    printf("-CompoundStatement::interpret() %p\n", e); 
     293#endif 
    288294    return e; 
    289295} 
     
    375381{ 
    376382#if LOG 
    377     printf("ReturnStatement::interpret()\n"); 
     383    printf("ReturnStatement::interpret(%s)\n", exp ? exp->toChars() : ""); 
    378384#endif 
    379385    START() 
    380     assert(exp); 
     386    if (!exp) 
     387    return EXP_VOID_INTERPRET; 
    381388    return exp->interpret(istate); 
    382389} 
     
    837844    { 
    838845    if (v->isConst() && v->init) 
    839         e = v->init->toExpression(); 
     846    {   e = v->init->toExpression(); 
     847        if (!e->type) 
     848        e->type = v->type; 
     849    } 
    840850    else 
    841851    {   e = v->value; 
     
    852862 
    853863Expression *DeclarationExp::interpret(InterState *istate) 
    854 {   Expression *e = EXP_CANT_INTERPRET; 
     864
     865#if LOG 
     866    printf("DeclarationExp::interpret() %s\n", toChars()); 
     867#endif 
     868    Expression *e = EXP_CANT_INTERPRET; 
    855869    VarDeclaration *v = declaration->isVarDeclaration(); 
    856870    if (v) 
     
    865879        e = NULL; 
    866880    } 
     881    else if (s == v && v->isConst() && v->init) 
     882    {   e = v->init->toExpression(); 
     883        if (!e) 
     884        e = EXP_CANT_INTERPRET; 
     885        else if (!e->type) 
     886        e->type = v->type; 
     887    } 
    867888    } 
    868889    return e; 
     
    870891 
    871892Expression *TupleExp::interpret(InterState *istate) 
    872 {   Expressions *expsx = NULL; 
     893
     894#if LOG 
     895    printf("VarExp::interpret() %s\n", toChars()); 
     896#endif 
     897    Expressions *expsx = NULL; 
    873898 
    874899    for (size_t i = 0; i < exps->dim; i++) 
     
    10321057    Expression *e2; 
    10331058 
     1059#if LOG 
     1060    printf("BinExp::interpretCommon2() %s\n", toChars()); 
     1061#endif 
    10341062    e1 = this->e1->interpret(istate); 
    10351063    if (e1 == EXP_CANT_INTERPRET) 
    10361064    goto Lcant; 
    1037     if (e1->isConst() != 1
     1065    if (e1->isConst() != 1 && e1->op != TOKstring && e1->op != TOKarrayliteral
    10381066    goto Lcant; 
    10391067 
     
    10411069    if (e2 == EXP_CANT_INTERPRET) 
    10421070    goto Lcant; 
    1043     if (e2->isConst() != 1
     1071    if (e2->isConst() != 1 && e2->op != TOKstring && e2->op != TOKarrayliteral
    10441072    goto Lcant; 
    10451073 
     
    11041132        if (e2 != EXP_CANT_INTERPRET) 
    11051133        { 
    1106             if (v->isAuto()) 
     1134            if (!(v->isDataseg() || v->isParameter())) 
    11071135            { 
    11081136            for (size_t i = 0; 1; i++) 
     
    12771305        if (eresult) 
    12781306            e = eresult; 
     1307        else if (fd->type->toBasetype()->next->ty == Tvoid) 
     1308            e = EXP_VOID_INTERPRET; 
    12791309        else 
    12801310            error("cannot evaluate %s at compile time", toChars()); 
     
    13351365    Expression *e2; 
    13361366 
     1367#if LOG 
     1368    printf("IndexExp::interpret() %s\n", toChars()); 
     1369#endif 
    13371370    e1 = this->e1->interpret(istate); 
    13381371    if (e1 == EXP_CANT_INTERPRET) 
  • branches/dmdfe/mangle.c

    r360 r415  
    3131    Dsymbol *s; 
    3232 
     33    //printf("::mangle(%s)\n", sthis->toChars()); 
    3334    s = sthis; 
    3435    do 
    3536    { 
    36     //printf("s = %p, '%s', parent = %p\n", s, s->toChars(), s->parent); 
     37    //printf("mangle: s = %p, '%s', parent = %p\n", s, s->toChars(), s->parent); 
    3738    if (s->ident) 
    3839    { 
     
    6162//    buf.prependstring("_D"); 
    6263L1: 
    63     //printf("deco = '%s'\n", sthis->type->deco); 
     64    //printf("deco = '%s'\n", sthis->type->deco ? sthis->type->deco : "null"); 
     65    //printf("sthis->type = %s\n", sthis->type->toChars()); 
    6466    FuncDeclaration *fd = sthis->isFuncDeclaration(); 
    6567    if (fd && (fd->needThis() || fd->isNested())) 
    6668    buf.writeByte(Type::needThisPrefix()); 
    67     buf.writestring(sthis->type->deco); 
     69    if (sthis->type->deco) 
     70    buf.writestring(sthis->type->deco); 
     71    else 
     72    {   assert(fd->inferRetType); 
     73    } 
    6874 
    6975    id = buf.toChars(); 
     
    135141        return "_Dmain"; 
    136142 
     143    assert(this); 
    137144    return Declaration::mangle(); 
    138145    } 
  • branches/dmdfe/mars.c

    r414 r415  
    5656    copyright = "Copyright (c) 1999-2007 by Digital Mars"; 
    5757    written = "written by Walter Bright"; 
    58     version = "v1.007"; 
     58    version = "v1.009"; 
    5959    global.structalign = 8; 
    6060 
  • branches/dmdfe/mars.h

    r361 r415  
    1818#include <stdint.h> 
    1919#include <stdarg.h> 
     20 
     21#ifdef __DMC__ 
     22#ifdef DEBUG 
     23#undef assert 
     24#define assert(e) (static_cast<void>((e) || (printf("assert %s(%d) %s\n", __FILE__, __LINE__, #e), halt()))) 
     25#endif 
     26#endif 
    2027 
    2128#ifdef IN_GCC 
  • branches/dmdfe/mtype.c

    r414 r415  
    30743074        sm = s->search(loc, id, 0); 
    30753075        if (!sm) 
    3076         {   error(loc, "template identifier %s is not a member of %s", id->toChars(), s->toChars()); 
     3076        { 
     3077#ifdef DEBUG 
     3078            printf("1: \n"); 
     3079#endif 
     3080            error(loc, "template identifier %s is not a member of %s %s", 
     3081            id->toChars(), s->kind(), s->toChars()); 
    30773082            return; 
    30783083        } 
     
    33103315    if (s) 
    33113316    { 
    3312     s = s->toAlias(); 
    33133317    for (int i = 0; i < idents.dim; i++) 
    33143318    {   Identifier *id; 
    33153319        Dsymbol *sm; 
    33163320 
     3321        s = s->toAlias(); 
    33173322        id = (Identifier *)idents.data[i]; 
    33183323        //printf("\tid = '%s'\n", id->toChars()); 
     
    33263331        sm = s->search(loc, id, 0); 
    33273332        if (!sm) 
    3328         {   error(loc, "template identifier %s is not a member of %s", id->toChars(), s->toChars()); 
    3329             break; 
     3333        { 
     3334            Type *t = s->getType(); 
     3335            if (t) 
     3336            sm = t->toDsymbol(sc); 
     3337            if (!sm) 
     3338            { 
     3339#ifdef DEBUG 
     3340            printf("E2: %s\n", s->getType()->toChars()); 
     3341#endif 
     3342            error(loc, "template identifier %s is not a member of %s %s", 
     3343                id->toChars(), s->kind(), s->toChars()); 
     3344            break; 
     3345            } 
     3346            sm = sm->toAlias(); 
    33303347        } 
    3331         sm = sm->toAlias(); 
    3332         td = sm->isTemplateDeclaration(); 
    3333         if (!td) 
     3348        else 
    33343349        { 
    3335             error(loc, "%s is not a template", id->toChars()); 
    3336             break; 
     3350            sm = sm->toAlias(); 
     3351            td = sm->isTemplateDeclaration(); 
     3352            if (!td) 
     3353            { 
     3354            error(loc, "%s %s is not a template", sm->kind(), id->toChars()); 
     3355            break; 
     3356            } 
     3357            ti->tempdecl = td; 
     3358            if (!ti->semanticdone) 
     3359            ti->semantic(sc); 
     3360            sm = ti->toAlias(); 
    33373361        } 
    3338         ti->tempdecl = td; 
    3339         if (!ti->semanticdone) 
    3340             ti->semantic(sc); 
    3341         sm = ti->toAlias(); 
    33423362        } 
    33433363        else 
     
    33493369        break; 
    33503370        } 
    3351         s = s->toAlias(); 
    33523371    } 
    33533372    } 
     
    42184237        return e; 
    42194238    } 
     4239    if (d->isTupleDeclaration()) 
     4240    { 
     4241        e = new TupleExp(e->loc, d->isTupleDeclaration()); 
     4242        e = e->semantic(sc); 
     4243        return e; 
     4244    } 
    42204245    return new VarExp(e->loc, d); 
    42214246    } 
     
    45494574        return e; 
    45504575    } 
     4576    else if (d->isTupleDeclaration()) 
     4577    { 
     4578        e = new TupleExp(e->loc, d->isTupleDeclaration()); 
     4579        e = e->semantic(sc); 
     4580        return e; 
     4581    } 
    45514582    else 
    45524583        ve = new VarExp(e->loc, d); 
  • branches/dmdfe/optimize.c

    r414 r415  
    4343Expression *fromConstInitializer(Expression *e1) 
    4444{ 
     45    //printf("fromConstInitializer(%s)\n", e1->toChars()); 
    4546    if (e1->op == TOKvar) 
    4647    {   VarExp *ve = (VarExp *)e1; 
  • branches/dmdfe/statement.c

    r414 r415  
    11371137    size_t n; 
    11381138    TupleExp *te = NULL; 
    1139     if (aggr->op == TOKtuple) 
     1139    if (aggr->op == TOKtuple)  // expression tuple 
    11401140    {   te = (TupleExp *)aggr; 
    11411141        n = te->exps->dim; 
    11421142    } 
    1143     else if (aggr->op == TOKtype) 
     1143    else if (aggr->op == TOKtype)  // type tuple 
    11441144    { 
    11451145        n = Argument::dim(tuple->arguments); 
     
    11831183        if (te) 
    11841184        { 
    1185         arg->type = e->type; 
    1186         Initializer *ie = new ExpInitializer(0, e); 
    1187         var = new VarDeclaration(loc, arg->type, arg->ident, ie); 
     1185        if (e->type->toBasetype()->ty == Tfunction && 
     1186            e->op == TOKvar) 
     1187        {   VarExp *ve = (VarExp *)e; 
     1188            var = new AliasDeclaration(loc, arg->ident, ve->var); 
     1189        } 
     1190        else 
     1191        { 
     1192            arg->type = e->type; 
     1193            Initializer *ie = new ExpInitializer(0, e); 
     1194            var = new VarDeclaration(loc, arg->type, arg->ident, ie); 
     1195        } 
    11881196        } 
    11891197        else 
  • branches/dmdfe/staticassert.c

    r360 r415  
    11 
    2 // Copyright (c) 1999-2006 by Digital Mars 
     2// Copyright (c) 1999-2007 by Digital Mars 
    33// All Rights Reserved 
    44// written by Walter Bright 
     
    5050 
    5151    e = exp->semantic(sc); 
    52     e = e->optimize(WANTvalue); 
     52    e = e->optimize(WANTvalue | WANTinterpret); 
    5353    if (e->isBool(FALSE)) 
    5454    { 
     
    5656    { 
    5757        msg = msg->semantic(sc); 
    58         msg = msg->optimize(WANTvalue); 
     58        msg = msg->optimize(WANTvalue | WANTinterpret); 
    5959        char *p = msg->toChars(); 
    6060        p = strdup(p); 
    61         error("(%s) is false, %s", exp->toChars(), p); 
     61        error("%s", p); 
    6262        free(p); 
    6363    } 
    6464    else 
    65         error("(%s) is false", exp->toChars()); 
     65        error("is false"); 
    6666    if (!global.gag) 
    6767        fatal(); 
  • branches/dmdfe/tocsym.c

    r360 r415  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2006 by Digital Mars 
     3// Copyright (c) 1999-2007 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    175175 
    176176    if (storage_class & STCout) 
    177         t = type_fake(TYnptr); 
     177    { 
     178        if (global.params.symdebug && storage_class & STCparameter) 
     179        { 
     180        t = type_alloc(TYref); 
     181        t->Tnext = type->toCtype(); 
     182        t->Tnext->Tcount++; 
     183        } 
     184        else 
     185        t = type_fake(TYnptr); 
     186    } 
    178187    else if (storage_class & STClazy) 
    179188        t = type_fake(TYullong);        // Tdelegate as C type 
     
    277286 */ 
    278287 
     288Symbol *FuncAliasDeclaration::toSymbol() 
     289{ 
     290    return funcalias->toSymbol(); 
     291} 
     292 
     293/************************************* 
     294 */ 
     295 
    279296Symbol *FuncDeclaration::toSymbol() 
    280297{ 
     
    289306    id = mangle(); 
    290307#endif 
    291     //printf("FuncDeclaration::toSymbol(%s)\n", toChars()); 
     308    //printf("FuncDeclaration::toSymbol(%s %s)\n", kind(), toChars()); 
    292309    //printf("\tid = '%s'\n", id); 
    293310    //printf("\ttype = %s\n", type->toChars()); 
     
    301318        f = s->Sfunc; 
    302319        f->Fstartline.Slinnum = loc.linnum; 
     320        f->Fstartline.Sfilename = loc.filename; 
    303321        if (endloc.linnum) 
    304         f->Fendline.Slinnum = endloc.linnum; 
     322        {   f->Fendline.Slinnum = endloc.linnum; 
     323        f->Fendline.Sfilename = endloc.filename; 
     324        } 
    305325        else 
    306         f->Fendline.Slinnum = loc.linnum; 
     326        {   f->Fendline.Slinnum = loc.linnum; 
     327        f->Fendline.Sfilename = loc.filename; 
     328        } 
    307329        t = type->toCtype(); 
    308330    } 
  • branches/dmdfe/todt.c

    r360 r415  
    426426#ifdef DEBUG 
    427427    printf("Expression::toDt() %d\n", op); 
     428    dump(0); 
    428429#endif 
    429430    error("non-constant expression %s", toChars());