Changeset 931 for trunk/rebuild

Show
Ignore:
Timestamp:
09/13/08 11:19:13 (4 months ago)
Author:
Gregor
Message:

rebuild/parse.c: Removed unnecessary errors.

rebuild/mars.c, rebuild/link.c: Fixed linking libraries.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/rebuild/link.c

    r922 r931  
    227227    global.params.exefile = strdup(out.c_str()); 
    228228    } 
    229      
     229 
    230230    // do we even need to do the build? 
    231231    if (global.params.fullbuild || 
  • trunk/rebuild/mars.c

    r928 r931  
    10071007    global.params.useAssert = 1; 
    10081008 
    1009     if (!global.params.obj || global.params.lib
     1009    if (!global.params.obj
    10101010    global.params.link = 0; 
    10111011 
     
    17231723     
    17241724    mem.fullcollect(); 
    1725      
     1725 
    17261726    // Now do the actual compilation, across any number of processors 
    17271727#ifndef _WIN32 
  • trunk/rebuild/parse.c

    r921 r931  
    7474    nextToken(); 
    7575    if (token.value != TOKidentifier) 
    76     {   error("Identifier expected following module"); 
     76    {   /* error("Identifier expected following module"); */ 
    7777        goto Lerr; 
    7878    } 
     
    9090        nextToken(); 
    9191        if (token.value != TOKidentifier) 
    92         {   error("Identifier expected following package"); 
     92        {   /* error("Identifier expected following package"); */ 
    9393            goto Lerr; 
    9494        } 
     
    9898        md = new ModuleDeclaration(a, id); 
    9999 
    100         if (token.value != TOKsemicolon) 
    101         error("';' expected following module declaration instead of %s", token.toChars()); 
     100        /* if (token.value != TOKsemicolon) 
     101        error("';' expected following module declaration instead of %s", token.toChars()); */ 
    102102        nextToken(); 
    103103        addComment(mod, comment); 
     
    107107    decldefs = parseDeclDefs(0); 
    108108    if (token.value != TOKeof) 
    109     {   error("unrecognized declaration"); 
     109    {   /* error("unrecognized declaration"); */ 
    110110    goto Lerr; 
    111111    } 
     
    390390            case TOKpublic: 
    391391            case TOKexport: 
    392             error("redundant protection attribute"); 
     392            /* error("redundant protection attribute"); */ 
    393393            break; 
    394394        } 
     
    408408            n = (unsigned)token.uns64value; 
    409409            else 
    410             {   error("integer expected, not %s", token.toChars()); 
     410            {   /* error("integer expected, not %s", token.toChars()); */ 
    411411            n = 1; 
    412412            } 
     
    429429        check(TOKlparen); 
    430430        if (token.value != TOKidentifier) 
    431         {   error("pragma(identifier expected"); 
     431        {   /* error("pragma(identifier expected"); */ 
    432432            goto Lerror; 
    433433        } 
     
    457457            s = new DebugSymbol(loc, (unsigned)token.uns64value); 
    458458            else 
    459             {   error("identifier or integer expected, not %s", token.toChars()); 
     459            {   /* error("identifier or integer expected, not %s", token.toChars()); */ 
    460460            s = NULL; 
    461461            } 
    462462            nextToken(); 
    463             if (token.value != TOKsemicolon) 
    464             error("semicolon expected"); 
     463            /* if (token.value != TOKsemicolon) 
     464            error("semicolon expected"); */ 
    465465            nextToken(); 
    466466            break; 
     
    480480            s = new VersionSymbol(loc, (unsigned)token.uns64value); 
    481481            else 
    482             {   error("identifier or integer expected, not %s", token.toChars()); 
     482            {   /* error("identifier or integer expected, not %s", token.toChars()); */ 
    483483            s = NULL; 
    484484            } 
    485485            nextToken(); 
    486             if (token.value != TOKsemicolon) 
    487             error("semicolon expected"); 
     486            /* if (token.value != TOKsemicolon) 
     487            error("semicolon expected"); */ 
    488488            nextToken(); 
    489489            break; 
     
    537537    { 
    538538    case TOKsemicolon: 
    539         error("declaration expected following attribute, not ';'"); 
     539        /* error("declaration expected following attribute, not ';'"); */ 
    540540        nextToken(); 
    541541        break; 
     
    546546        if (token.value != TOKrcurly) 
    547547        {   /* { */ 
    548         error("matching '}' expected, not %s", token.toChars()); 
     548        /* error("matching '}' expected, not %s", token.toChars()); */ 
    549549        } 
    550550        else 
     
    656656    else 
    657657    { 
    658         error("valid linkage identifiers are D, C, C++, Pascal, Windows, System"); 
     658        /* error("valid linkage identifiers are D, C, C++, Pascal, Windows, System"); */ 
    659659        link = LINKd; 
    660660    } 
     
    686686    else if (token.value == TOKint32v) 
    687687        level = (unsigned)token.uns64value; 
    688     else 
    689         error("identifier or integer expected, not %s", token.toChars()); 
     688    /* else 
     689        error("identifier or integer expected, not %s", token.toChars()); */ 
    690690    nextToken(); 
    691691    check(TOKrparen); 
     
    723723        id = Lexer::idPool(Token::toChars(TOKunittest)); 
    724724#endif 
    725     else 
    726         error("identifier or integer expected, not %s", token.toChars()); 
     725    /* else 
     726        error("identifier or integer expected, not %s", token.toChars()); */ 
    727727    nextToken(); 
    728728    check(TOKrparen); 
    729729 
    730730    } 
    731     else 
    732        error("(condition) expected following version"); 
     731    /* else 
     732       error("(condition) expected following version"); */ 
    733733    c = new VersionCondition(mod, level, id); 
    734734    return c; 
     
    758758    } 
    759759    else 
    760     {   error("(expression) expected following static if"); 
     760    {   /* error("(expression) expected following static if"); */ 
    761761    exp = NULL; 
    762762    } 
     
    956956    nextToken(); 
    957957    arguments = parseParameters(&varargs); 
    958     if (varargs) 
    959     error("... not allowed in delete function parameter list"); 
     958    /* if (varargs) 
     959    error("... not allowed in delete function parameter list"); */ 
    960960    f = new DeleteDeclaration(loc, 0, arguments); 
    961961    parseContracts(f); 
     
    11721172        { 
    11731173        type = parseType(&ident, NULL); 
    1174         if (id || memtype) 
    1175             error("type only allowed if anonymous enum and no enum type"); 
     1174        /* if (id || memtype) 
     1175            error("type only allowed if anonymous enum and no enum type"); */ 
    11761176        } 
    11771177 
     
    11841184        else 
    11851185        {   value = NULL; 
    1186         if (type) 
    1187             error("if type, there must be an initializer"); 
     1186        /* if (type) 
     1187            error("if type, there must be an initializer"); */ 
    11881188        } 
    11891189 
     
    12031203    nextToken(); 
    12041204    } 
    1205     else 
    1206     error("enum declaration is invalid"); 
     1205    /* else 
     1206    error("enum declaration is invalid"); */ 
    12071207 
    12081208    //printf("-parseEnum() %s\n", e->toChars()); 
     
    12521252        baseclasses = parseBaseClasses(); 
    12531253 
    1254         if (token.value != TOKlcurly) 
    1255             error("members expected"); 
     1254        /* if (token.value != TOKlcurly) 
     1255            error("members expected"); */ 
    12561256        } 
    12571257 
     
    12891289    nextToken(); 
    12901290    Array *decl = parseDeclDefs(0); 
    1291     if (token.value != TOKrcurly) 
    1292         error("} expected following member declarations in aggregate"); 
     1291    /* if (token.value != TOKrcurly) 
     1292        error("} expected following member declarations in aggregate"); */ 
    12931293    nextToken(); 
    12941294    if (anon) 
     
    13031303    else 
    13041304    { 
    1305     error("{ } expected following aggregate declaration"); 
     1305    /* error("{ } expected following aggregate declaration"); */ 
    13061306    a = new StructDeclaration(loc, NULL); 
    13071307    } 
     
    13581358    else 
    13591359    { 
    1360         error("base classes expected instead of %s", token.toChars()); 
     1360        /* error("base classes expected instead of %s", token.toChars()); */ 
    13611361        return NULL; 
    13621362    } 
     
    14011401    nextToken(); 
    14021402    if (token.value != TOKidentifier) 
    1403     {   error("TemplateIdentifier expected following template"); 
     1403    {   /* error("TemplateIdentifier expected following template"); */ 
    14041404    goto Lerr; 
    14051405    } 
     
    14131413 
    14141414    if (token.value != TOKlcurly) 
    1415     {   error("members of template declaration expected"); 
     1415    {   /* error("members of template declaration expected"); */ 
    14161416    goto Lerr; 
    14171417    } 
     
    14211421    decldefs = parseDeclDefs(0); 
    14221422    if (token.value != TOKrcurly) 
    1423     {   error("template member expected"); 
     1423    {   /* error("template member expected"); */ 
    14241424        goto Lerr; 
    14251425    } 
     
    14461446 
    14471447    if (!flag && token.value != TOKlparen) 
    1448     {   error("parenthesized TemplateParameterList expected following TemplateIdentifier"); 
     1448    {   /* error("parenthesized TemplateParameterList expected following TemplateIdentifier"); */ 
    14491449    goto Lerr; 
    14501450    } 
     
    14801480        { 
    14811481            if (token.value != TOKidentifier) 
    1482             {   error("identifier expected for template alias parameter"); 
     1482            {   /* error("identifier expected for template alias parameter"); */ 
    14831483            goto Lerr; 
    14841484            } 
     
    15101510        {   // TypeParameter 
    15111511        if (token.value != TOKidentifier) 
    1512         {   error("identifier expected for template type parameter"); 
     1512        {   /* error("identifier expected for template type parameter"); */ 
    15131513            goto Lerr; 
    15141514        } 
     
    15291529        else if (token.value == TOKidentifier && t->value == TOKdotdotdot) 
    15301530        {   // ident... 
    1531         if (isvariadic) 
    1532             error("variadic template parameter must be last"); 
     1531        /* if (isvariadic) 
     1532            error("variadic template parameter must be last"); */ 
    15331533        isvariadic = 1; 
    15341534        tp_ident = token.ident; 
     
    15651565        if (!tp_ident) 
    15661566        { 
    1567             error("identifier expected for template value parameter"); 
     1567            /* error("identifier expected for template value parameter"); */ 
    15681568            tp_ident = new Identifier("error", TOKidentifier); 
    15691569        } 
     
    16241624    if (token.value != TOKidentifier) 
    16251625    { 
    1626         error("identifier expected, not %s", token.toChars()); 
     1626        /* error("identifier expected, not %s", token.toChars()); */ 
    16271627        id = Id::empty; 
    16281628    } 
     
    16551655    nextToken(); 
    16561656    if (token.value != TOKidentifier) 
    1657     {   error("identifier expected following '.' instead of '%s'", token.toChars()); 
     1657    {   /* error("identifier expected following '.' instead of '%s'", token.toChars()); */ 
    16581658        break; 
    16591659    } 
     
    16721672 
    16731673    tm = new TemplateMixin(loc, id, tqual, idents, tiargs); 
    1674     if (token.value != TOKsemicolon) 
    1675     error("';' expected after mixin"); 
     1674    /* if (token.value != TOKsemicolon) 
     1675    error("';' expected after mixin"); */ 
    16761676    nextToken(); 
    16771677 
     
    16911691    //printf("Parser::parseTemplateArgumentList()\n"); 
    16921692    if (token.value != TOKlparen) 
    1693     {   error("!(TemplateArgumentList) expected following TemplateIdentifier"); 
     1693    {   /* error("!(TemplateArgumentList) expected following TemplateIdentifier"); */ 
    16941694    return new Objects(); 
    16951695    } 
     
    17401740    nextToken(); 
    17411741    if (token.value != TOKidentifier) 
    1742     {   error("Identifier expected following import"); 
     1742    {   /* error("Identifier expected following import"); */ 
    17431743        break; 
    17441744    } 
     
    17601760        nextToken(); 
    17611761        if (token.value != TOKidentifier) 
    1762         {   error("Identifier expected following package"); 
     1762        {   /* error("Identifier expected following package"); */ 
    17631763        break; 
    17641764        } 
     
    17821782        nextToken(); 
    17831783        if (token.value != TOKidentifier) 
    1784         {   error("Identifier expected following :"); 
     1784        {   /* error("Identifier expected following :"); */ 
    17851785            break; 
    17861786        } 
     
    17911791            nextToken(); 
    17921792            if (token.value != TOKidentifier) 
    1793             {   error("Identifier expected following %s=", alias->toChars()); 
     1793            {   /* error("Identifier expected following %s=", alias->toChars()); */ 
    17941794            break; 
    17951795            } 
     
    18131813    else 
    18141814    { 
    1815     error("';' expected"); 
     1815    /* error("';' expected"); */ 
    18161816    nextToken(); 
    18171817    } 
     
    18761876        {   nextToken(); 
    18771877        if (token.value != TOKidentifier) 
    1878         {   error("identifier expected following '.' instead of '%s'", token.toChars()); 
     1878        {   /* error("identifier expected following '.' instead of '%s'", token.toChars()); */ 
    18791879            break; 
    18801880        } 
     
    19231923 
    19241924    default: 
    1925         error("basic type expected, not %s", token.toChars()); 
     1925        /* error("basic type expected, not %s", token.toChars()); */ 
    19261926        t = Type::tint32; 
    19271927        break; 
     
    22502250        unsigned u = storage_class; 
    22512251        u &= STCconst | STCinvariant | STCmanifest; 
    2252         if (u & (u - 1)) 
    2253             error("conflicting storage class %s", Token::toChars(token.value)); 
     2252        /* if (u & (u - 1)) 
     2253            error("conflicting storage class %s", Token::toChars(token.value)); */ 
    22542254        } 
    22552255        nextToken(); 
     
    23272327        error("multiple declarations must have the same type, not %s and %s", 
    23282328        tfirst->toChars(), t->toChars()); */ 
    2329     if (!ident) 
    2330         error("no identifier for declarator %s", t->toChars()); 
     2329    /* if (!ident) 
     2330        error("no identifier for declarator %s", t->toChars()); */ 
    23312331 
    23322332    if (tok == TOKtypedef || tok == TOKalias) 
     
    23682368 
    23692369        default: 
    2370             error("semicolon expected to close %s declaration", Token::toChars(tok)); 
     2370            /* error("semicolon expected to close %s declaration", Token::toChars(tok)); */ 
    23712371            break; 
    23722372        } 
     
    24472447 
    24482448        default: 
    2449             error("semicolon expected, not '%s'", token.toChars()); 
     2449            /* error("semicolon expected, not '%s'", token.toChars()); */ 
    24502450            break; 
    24512451        } 
     
    24932493        continue; 
    24942494        } 
    2495         else 
    2496         error("Identifier expected following comma"); 
    2497     } 
    2498     else 
    2499         error("semicolon expected following auto declaration, not '%s'", token.toChars()); 
     2495        /* else 
     2496        error("Identifier expected following comma"); */ 
     2497    } 
     2498    /* else 
     2499        error("semicolon expected following auto declaration, not '%s'", token.toChars()); */ 
    25002500    break; 
    25012501    } 
     
    25202520    { 
    25212521    case TOKlcurly: 
    2522         if (f->frequire || f->fensure) 
    2523         error("missing body { ... } after in or out"); 
     2522        /* if (f->frequire || f->fensure) 
     2523        error("missing body { ... } after in or out"); */ 
    25242524        f->fbody = parseStatement(PSsemi); 
    25252525        f->endloc = endloc; 
     
    25332533 
    25342534    case TOKsemicolon: 
    2535         if (f->frequire || f->fensure) 
    2536         error("missing body { ... } after in or out"); 
     2535        /* if (f->frequire || f->fensure) 
     2536        error("missing body { ... } after in or out"); */ 
    25372537        nextToken(); 
    25382538        break; 
     
    25782578        { 
    25792579        check(TOKlparen); 
    2580         if (token.value != TOKidentifier)     
    2581             error("(identifier) following 'out' expected, not %s", token.toChars()); 
     2580        /* if (token.value != TOKidentifier)      
     2581            error("(identifier) following 'out' expected, not %s", token.toChars()); */ 
    25822582        f->outId = token.ident; 
    25832583        nextToken(); 
     
    25902590 
    25912591    default: 
    2592         error("semicolon expected following function declaration"); 
     2592        /* error("semicolon expected following function declaration"); */ 
    25932593        break; 
    25942594    } 
     
    26832683 
    26842684            case TOKeof: 
    2685             error("found EOF instead of initializer"); 
     2685            /* error("found EOF instead of initializer"); */ 
    26862686            break; 
    26872687 
     
    28482848    //printf("parseStatement()\n"); 
    28492849 
    2850     if (flags & PScurly && token.value != TOKlcurly) 
    2851     error("statement expected to be { }, not %s", token.toChars()); 
     2850    /* if (flags & PScurly && token.value != TOKlcurly) 
     2851    error("statement expected to be { }, not %s", token.toChars()); */ 
    28522852 
    28532853    switch (token.value) 
     
    31633163        } 
    31643164        at = parseType(&ai); 
    3165         if (!ai) 
    3166             error("no identifier for declarator %s", at->toChars()); 
     3165        /* if (!ai) 
     3166            error("no identifier for declarator %s", at->toChars()); */ 
    31673167          Larg: 
    31683168        a = new Argument(storageClass, at, ai, NULL); 
     
    36513651            case TOKeof: 
    36523652            /* { */ 
    3653             error("matching '}' expected, not end of file"); 
     3653            /* error("matching '}' expected, not end of file"); */ 
    36543654            break; 
    36553655 
     
    36723672 
    36733673    default: 
    3674         error("found '%s' instead of statement", token.toChars()); 
     3674        /* error("found '%s' instead of statement", token.toChars()); */ 
    36753675        goto Lerror; 
    36763676 
     
    36963696void Parser::check(Loc loc, enum TOK value) 
    36973697{ 
    3698     if (token.value != value) 
    3699     error(loc, "found '%s' when expecting '%s'", token.toChars(), Token::toChars(value)); 
     3698    /* if (token.value != value) 
     3699    error(loc, "found '%s' when expecting '%s'", token.toChars(), Token::toChars(value)); */ 
    37003700    nextToken(); 
    37013701} 
     
    37033703void Parser::check(enum TOK value, const char *string) 
    37043704{ 
    3705     if (token.value != value) 
     3705    /* if (token.value != value) 
    37063706    error("found '%s' when expecting '%s' following '%s'", 
    3707         token.toChars(), Token::toChars(value), string); 
     3707        token.toChars(), Token::toChars(value), string); */ 
    37083708    nextToken(); 
    37093709} 
     
    44304430        check(TOKdot, t->toChars()); 
    44314431        if (token.value != TOKidentifier) 
    4432         {   error("found '%s' when expecting identifier following '%s.'", token.toChars(), t->toChars()); 
     4432        {   /* error("found '%s' when expecting identifier following '%s.'", token.toChars(), t->toChars()); */ 
    44334433        goto Lerr; 
    44344434        } 
     
    47334733            continue; 
    47344734        } 
    4735         else 
    4736             error("identifier expected following '.', not '%s'", token.toChars()); 
     4735        /* else 
     4736            error("identifier expected following '.', not '%s'", token.toChars()); */ 
    47374737        break; 
    47384738 
     
    49624962                nextToken(); 
    49634963                if (token.value != TOKidentifier) 
    4964                 {   error("Identifier expected following (type)."); 
     4964                {   /* error("Identifier expected following (type)."); */ 
    49654965                return NULL; 
    49664966                } 
     
    54505450 
    54515451    if (token.value != TOKlcurly) 
    5452     {   error("{ members } expected for anonymous class"); 
     5452    {   /* error("{ members } expected for anonymous class"); */ 
    54535453        cd->members = NULL; 
    54545454    } 
     
    54575457        nextToken(); 
    54585458        Array *decl = parseDeclDefs(0); 
    5459         if (token.value != TOKrcurly) 
    5460         error("class member expected"); 
     5459        /* if (token.value != TOKrcurly) 
     5460        error("class member expected"); */ 
    54615461        nextToken(); 
    54625462        cd->members = decl;