Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 1103:b30fe7e1dbb9

Show
Ignore:
Timestamp:
03/12/09 15:37:27 (3 years ago)
Author:
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
branch:
default
Message:

- Updated to DMD frontend 1.041.
- Removed dmd/inifile.c , it's not under a free license, replaced with libconfig based config file.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CMakeLists.txt

    r1074 r1103  
    1010endif(NOT PERL) 
    1111 
     12include(FindPkgConfig) 
     13if(NOT PKG_CONFIG_FOUND) 
     14    message(FATAL_ERROR "pkg-config not found") 
     15else(NOT PKG_CONFIG_FOUND) 
     16    pkg_search_module(LIBCONFIGPP libconfig++) 
     17    if(NOT LIBCONFIGPP_FOUND) 
     18        message(FATAL_ERROR "libconfig++ not found") 
     19    endif(NOT LIBCONFIGPP_FOUND) 
     20    set(LIBCONFIG_CXXFLAGS ${LIBCONFIGPP_CFLAGS} CACHE STRING "libconfig++ compiler flags") 
     21    set(LIBCONFIG_LDFLAGS ${LIBCONFIGPP_LDFLAGS} CACHE STRING "libconfig++ linker flags") 
     22endif(NOT PKG_CONFIG_FOUND) 
     23 
     24 
    1225find_program(LLVM_CONFIG llvm-config ${LLVM_INSTDIR}/bin DOC "path to llvm-config tool") 
    1326# get llvm's install dir. a little hackish, we could do something like llvm-config --prefix, but this does as well 
     
    4053) 
    4154execute_process( 
    42     COMMAND ${PERL_EXECUTABLE} ${LLVM_CONFIG} --libfiles bitwriter linker ipo instrumentation backend 
     55    COMMAND ${PERL_EXECUTABLE} ${LLVM_CONFIG} --libfiles bitwriter linker ipo instrumentation backend arm 
    4356    OUTPUT_VARIABLE LLVM_LIBS 
    4457    OUTPUT_STRIP_TRAILING_WHITESPACE 
     
    162175    add_definitions(-DDEFAULT_TARGET_TRIPLE=\\"${DEFAULT_TARGET}\\") 
    163176    add_definitions(-DDEFAULT_ALT_TARGET_TRIPLE=\\"${DEFAULT_ALT_TARGET}\\") 
     177    add_definitions(-DLDC_INSTALL_PREFIX=\\"${CMAKE_INSTALL_PREFIX}\\") 
    164178else(CMAKE_MINOR_VERSION LESS 6) 
    165179    add_definitions(-DDEFAULT_TARGET_TRIPLE="${DEFAULT_TARGET}") 
    166180    add_definitions(-DDEFAULT_ALT_TARGET_TRIPLE="${DEFAULT_ALT_TARGET}") 
     181    add_definitions(-DLDC_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") 
    167182endif(CMAKE_MINOR_VERSION LESS 6) 
    168183 
     
    191206    OUTPUT_NAME ${LDC_EXE_NAME} 
    192207    RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin 
    193     COMPILE_FLAGS "${LLVM_CXXFLAGS} -Wno-deprecated -Wno-write-strings" 
     208    COMPILE_FLAGS "${LLVM_CXXFLAGS} ${LIBCONFIG_CXXFLAGS} -Wno-deprecated -Wno-write-strings" 
    194209) 
    195210 
    196211# LDFLAGS should actually be in target property LINK_FLAGS, but this works, and gets around linking problems 
    197 target_link_libraries(${LDC_EXE} "${LLVM_LDFLAGS} ${LLVM_LIBS}") 
     212target_link_libraries(${LDC_EXE} "${LLVM_LDFLAGS} ${LLVM_LIBS} ${LIBCONFIG_LDFLAGS}") 
    198213if(WIN32) 
    199214    target_link_libraries(${LDC_EXE} psapi) 
  • dmd/access.c

    r336 r1103  
    1414 
    1515#include "root.h" 
    16 #include "mem.h" 
     16#include "rmem.h" 
    1717 
    1818#include "enum.h" 
  • dmd/array.c

    r872 r1103  
    4242#include "root.h" 
    4343#include "dchar.h" 
    44 #include "mem.h" 
     44#include "rmem.h" 
    4545 
    4646 
  • dmd/arrayop.c

    r703 r1103  
    1212#include <assert.h> 
    1313 
    14 #if _WIN32 || IN_GCC  || IN_LLVM 
    15 #include "mem.h" 
    16 #else 
    17 #include "../root/mem.h" 
    18 #endif 
     14#include "rmem.h" 
    1915 
    2016#include "stringtable.h" 
  • dmd/attrib.c

    r986 r1103  
    1313#include <assert.h> 
    1414 
    15 #if _WIN32 || IN_GCC || IN_LLVM 
    16 #include "mem.h" 
    17 #elif POSIX 
    18 #include "../root/mem.h" 
    19 #endif 
     15#include "rmem.h" 
    2016 
    2117#include "init.h" 
     
    152148    //printf("AttribDeclaration::emitComment(sc = %p)\n", sc); 
    153149 
     150    /* A general problem with this, illustrated by BUGZILLA 2516, 
     151     * is that attributes are not transmitted through to the underlying 
     152     * member declarations for template bodies, because semantic analysis 
     153     * is not done for template declaration bodies 
     154     * (only template instantiations). 
     155     * Hence, Ddoc omits attributes from template members. 
     156     */ 
     157 
    154158    Array *d = include(NULL, NULL); 
    155159 
     
    327331    { STCextern,       TOKextern }, 
    328332    { STCconst,        TOKconst }, 
     333//  { STCinvariant,    TOKimmutable }, 
     334//  { STCshared,       TOKshared }, 
    329335    { STCfinal,        TOKfinal }, 
    330336    { STCabstract,     TOKabstract }, 
     
    332338    { STCdeprecated,   TOKdeprecated }, 
    333339    { STCoverride,     TOKoverride }, 
     340//  { STCnothrow,      TOKnothrow }, 
     341//  { STCpure,         TOKpure }, 
     342//  { STCref,          TOKref }, 
     343//  { STCtls,          TOKtls }, 
    334344    }; 
    335345 
     
    613623    sc = sc->push(); 
    614624    sc->anonAgg = &aad; 
    615     sc->stc &= ~(STCauto | STCscope | STCstatic); 
     625    sc->stc &= ~(STCauto | STCscope | STCstatic | STCtls); 
    616626    sc->inunion = isunion; 
    617627    sc->offset = 0; 
     
    754764Dsymbol *PragmaDeclaration::syntaxCopy(Dsymbol *s) 
    755765{ 
     766    //printf("PragmaDeclaration::syntaxCopy(%s)\n", toChars()); 
    756767    PragmaDeclaration *pd; 
    757768 
     
    13941405int CompileDeclaration::addMember(Scope *sc, ScopeDsymbol *sd, int memnum) 
    13951406{ 
    1396     //printf("CompileDeclaration::addMember(sc = %p)\n", sc); 
     1407    //printf("CompileDeclaration::addMember(sc = %p, memnum = %d)\n", sc, memnum); 
    13971408    this->sd = sd; 
    13981409    if (memnum == 0) 
  • dmd/cast.c

    r846 r1103  
    1111#include <assert.h> 
    1212 
    13 #if _WIN32 || IN_GCC || IN_LLVM 
    14 #include "mem.h" 
    15 #else 
    16 #include "../root/mem.h" 
    17 #endif 
     13#include "rmem.h" 
    1814 
    1915#include "expression.h" 
  • dmd/class.c

    r875 r1103  
    1414 
    1515#include "root.h" 
    16 #include "mem.h" 
     16#include "rmem.h" 
    1717 
    1818#include "enum.h" 
     
    858858    for (size_t i = 0; i < vtbl->dim; i++) 
    859859    { 
    860         FuncDeclaration *fd = (FuncDeclaration *)vtbl->data[i]; 
     860        FuncDeclaration *fd = ((Dsymbol*)vtbl->data[i])->isFuncDeclaration(); 
     861        if (!fd) 
     862        continue;       // the first entry might be a ClassInfo 
    861863 
    862864        //printf("\t[%d] = %s\n", i, fd->toChars()); 
  • dmd/cond.c

    r990 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2006 by Digital Mars 
     3// Copyright (c) 1999-2008 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    3232    for (int i = 0; i < ids->dim; i++) 
    3333    { 
    34         char *id = (char *)ids->data[i]; 
     34        const char *id = (const char *)ids->data[i]; 
    3535 
    3636        if (strcmp(id, ident->toChars()) == 0) 
     
    7676    if (!global.params.debugids) 
    7777    global.params.debugids = new Array(); 
    78     global.params.debugids->push((void*)ident); 
     78    global.params.debugids->push((void *)ident); 
    7979} 
    8080 
     
    128128    static const char* reserved[] = 
    129129    { 
    130     "DigitalMars", "LLVM", "LDC", "LLVM64", 
    131     "X86", "X86_64", "PPC", "PPC64", 
     130    "DigitalMars", "X86", "X86_64", 
    132131    "Windows", "Win32", "Win64", 
    133     "linux", "darwin", "Posix", 
     132    "linux", "Posix", "OSX", "FreeBSD", 
    134133    "LittleEndian", "BigEndian", 
    135134    "all", 
    136135    "none", 
     136 
     137    // LDC 
     138    "LLVM", "LDC", "LLVM64", 
     139    "PPC", "PPC64", 
     140    "darwin", 
    137141    }; 
    138142 
     
    162166    if (!global.params.versionids) 
    163167    global.params.versionids = new Array(); 
    164     global.params.versionids->push((void*)ident); 
     168    global.params.versionids->push((void *)ident); 
    165169} 
    166170 
  • dmd/cond.h

    r988 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2006 by Digital Mars 
     3// Copyright (c) 1999-2008 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
  • dmd/constfold.c

    r735 r1103  
    1818#endif 
    1919 
    20 #include "mem.h" 
     20#include "rmem.h" 
    2121#include "root.h" 
    2222 
     
    11731173 
    11741174    if (i >= es1->len) 
    1175         e1->error("string index %llu is out of bounds [0 .. %"PRIuSIZE"]", i, es1->len); 
     1175       e1->error("string index %ju is out of bounds [0 .. %zu]", i, es1->len); 
    11761176    else 
    11771177    {   unsigned value = es1->charAt(i); 
     
    11851185 
    11861186    if (i >= length) 
    1187     { 
    1188         e2->error("array index %llu is out of bounds %s[0 .. %llu]", i, e1->toChars(), length); 
     1187    {   e2->error("array index %ju is out of bounds %s[0 .. %ju]", i, e1->toChars(), length); 
    11891188    } 
    11901189    else if (e1->op == TOKarrayliteral && !e1->checkSideEffect(2)) 
     
    12011200    {   ArrayLiteralExp *ale = (ArrayLiteralExp *)e1; 
    12021201        if (i >= ale->elements->dim) 
    1203         { 
    1204             e2->error("array index %llu is out of bounds %s[0 .. %u]", i, e1->toChars(), ale->elements->dim); 
     1202        {   e2->error("array index %ju is out of bounds %s[0 .. %u]", i, e1->toChars(), ale->elements->dim); 
    12051203        } 
    12061204        else 
     
    12521250 
    12531251    if (iupr > es1->len || ilwr > iupr) 
    1254         e1->error("string slice [%llu .. %llu] is out of bounds", ilwr, iupr); 
     1252       e1->error("string slice [%ju .. %ju] is out of bounds", ilwr, iupr); 
    12551253    else 
    12561254    {   integer_t value; 
     
    12791277 
    12801278    if (iupr > es1->elements->dim || ilwr > iupr) 
    1281         e1->error("array slice [%llu .. %llu] is out of bounds", ilwr, iupr); 
     1279       e1->error("array slice [%ju .. %ju] is out of bounds", ilwr, iupr); 
    12821280    else 
    12831281    { 
  • dmd/dchar.c

    r1 r1103  
    1515 
    1616#include "dchar.h" 
    17 #include "mem.h" 
     17#include "rmem.h" 
    1818 
    1919#if M_UNICODE 
  • dmd/declaration.c

    r920 r1103  
    751751 
    752752        OutBuffer buf; 
    753         buf.printf("_%s_field_%"PRIuSIZE, ident->toChars(), i); 
     753       buf.printf("_%s_field_%zu", ident->toChars(), i); 
    754754        buf.writeByte(0); 
    755755        char *name = (char *)buf.extractData(); 
  • dmd/doc.c

    r876 r1103  
    1717#include <assert.h> 
    1818 
    19 #if IN_GCC || IN_LLVM 
    20 #include "mem.h" 
    21 #else 
    22 #if _WIN32 
    23 #include "..\root\mem.h" 
    24 #elif POSIX 
    25 #include "../root/mem.h" 
    26 #else 
    27 #error "fix this" 
    28 #endif 
    29 #endif 
     19#include "rmem.h" 
    3020 
    3121#include "root.h" 
  • dmd/dsymbol.c

    r946 r1103  
    1313#include <assert.h> 
    1414 
    15 #include "mem.h" 
     15#include "rmem.h" 
    1616 
    1717#include "mars.h" 
  • dmd/entity.c

    r1 r1103  
    11 
    2 // Copyright (c) 1999-2006 by Digital Mars 
     2// Copyright (c) 1999-2009 by Digital Mars 
    33// All Rights Reserved 
    44// written by Walter Bright 
     
    2020struct NameId 
    2121{ 
    22     char *name; 
     22    const char *name; 
    2323    unsigned short value; 
    2424}; 
  • dmd/expression.c

    r1012 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2008 by Digital Mars 
     3// Copyright (c) 1999-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    1212#include <stdlib.h> 
    1313#include <ctype.h> 
     14#include <math.h> 
    1415#include <assert.h> 
    1516#if _MSC_VER 
     
    1718#else 
    1819#endif 
    19 #include <math.h> 
    2020 
    2121#if _WIN32 && __DMC__ 
     
    4444#endif 
    4545 
    46 #if IN_GCC || IN_LLVM 
    47 #include "mem.h" 
    48 #elif _WIN32 
    49 #include "..\root\mem.h" 
    50 #elif POSIX 
    51 #include "../root/mem.h" 
    52 #endif 
     46#include "rmem.h" 
    5347 
    5448//#include "port.h" 
     
    561555 
    562556    if (nargs > nparams && tf->varargs == 0) 
    563         error(loc, "expected %"PRIuSIZE" arguments, not %"PRIuSIZE, nparams, nargs); 
     557   error(loc, "expected %zu arguments, not %zu", nparams, nargs); 
    564558 
    565559    n = (nargs > nparams) ? nargs : nparams;    // n = max(nargs, nparams) 
     
    586580            if (tf->varargs == 2 && i + 1 == nparams) 
    587581            goto L2; 
    588             error(loc, "expected %"PRIuSIZE" arguments, not %"PRIuSIZE, nparams, nargs); 
     582           error(loc, "expected %zu arguments, not %zu", nparams, nargs); 
    589583            break; 
    590584        } 
     
    608602        { 
    609603            if (nargs != nparams) 
    610                 error(loc, "expected %"PRIuSIZE" arguments, not %"PRIuSIZE, nparams, nargs); 
     604               error(loc, "expected %zu arguments, not %zu", nparams, nargs); 
    611605            goto L1; 
    612606        } 
     
    966960} 
    967961 
     962void Expression::warning(const char *format, ...) 
     963{ 
     964    if (global.params.warnings && !global.gag) 
     965    { 
     966    fprintf(stdmsg, "warning - "); 
     967    va_list ap; 
     968    va_start(ap, format); 
     969    ::warning(loc, format, ap); 
     970    va_end( ap ); 
     971    } 
     972} 
     973 
    968974void Expression::rvalue() 
    969975{ 
     
    13201326#else 
    13211327    static char buffer[sizeof(value) * 3 + 1]; 
    1322     sprintf(buffer, "%lld", value); 
     1328 
     1329    sprintf(buffer, "%jd", value); 
    13231330    return buffer; 
    13241331#endif 
     
    15021509 
    15031510        case Tint64: 
    1504         buf->printf("%lldL", v); 
     1511        buf->printf("%jdL", v); 
    15051512        break; 
    15061513 
    15071514        case Tuns64: 
    1508         buf->printf("%lluLU", v); 
     1515        buf->printf("%juLU", v); 
    15091516        break; 
    15101517 
     
    15351542    } 
    15361543    else if (v & 0x8000000000000000LL) 
    1537     buf->printf("0x%llx", v); 
     1544    buf->printf("0x%jx", v); 
    15381545    else 
    1539     buf->printf("%lld", v); 
     1546    buf->printf("%jd", v); 
    15401547} 
    15411548 
     
    15431550{ 
    15441551    if ((sinteger_t)value < 0) 
    1545     buf->printf("N%lld", -value); 
     1552    buf->printf("N%jd", -value); 
    15461553    else 
    1547     buf->printf("%lld", value); 
     1554    buf->printf("%jd", value); 
    15481555} 
    15491556 
     
    16181625int RealEquals(real_t x1, real_t x2) 
    16191626{ 
     1627#if __APPLE__ 
     1628    return (__inline_isnan(x1) && __inline_isnan(x2)) || 
     1629#else 
    16201630    return // special case nans 
    16211631       (isnan(x1) && isnan(x2)) || 
     1632#endif 
    16221633       // and zero, in order to distinguish +0 from -0 
    16231634       (x1 == 0 && x2 == 0 && 1./x1 == 1./x2) || 
     
    17241735     */ 
    17251736 
     1737#if __APPLE__ 
     1738    if (__inline_isnan(value)) 
     1739#else 
    17261740    if (isnan(value)) 
     1741#endif 
    17271742    buf->writestring("NAN");    // no -NAN bugs 
    17281743    else 
     
    38603875    VarDeclaration *v = var->isVarDeclaration(); 
    38613876    if (v) 
    3862     { 
    3863     v->checkNestedReference(sc, loc); 
    3864     } 
     3877    v->checkNestedReference(sc, loc); 
    38653878    return this; 
    38663879} 
     
    72307243    else 
    72317244    { 
    7232         error("string slice [%llu .. %llu] is out of bounds", i1, i2); 
     7245        error("string slice [%ju .. %ju] is out of bounds", i1, i2); 
    72337246        e = e1; 
    72347247    } 
     
    72367249    } 
    72377250 
    7238     type = t->nextOf()->arrayOf(); 
     7251    if (t->ty == Tarray) 
     7252    type = e1->type; 
     7253    else 
     7254    type = t->nextOf()->arrayOf(); 
    72397255    return e; 
    72407256 
     
    76117627        else 
    76127628        { 
    7613         error("array index [%llu] is outside array bounds [0 .. %"PRIuSIZE"]", 
    7614             index, length); 
    7615         e = e1; 
     7629       error("array index [%ju] is outside array bounds [0 .. %zu]", 
     7630           index, length); 
     7631       e = e1; 
    76167632        } 
    76177633        break; 
  • dmd/expression.h

    r876 r1103  
    7979FuncDeclaration *hasThis(Scope *sc); 
    8080Expression *fromConstInitializer(int result, Expression *e); 
     81int arrayExpressionCanThrow(Expressions *exps); 
    8182 
    8283struct Expression : Object 
     
    9899    virtual void dump(int indent); 
    99100    void error(const char *format, ...); 
     101    void warning(const char *format, ...); 
    100102    virtual void rvalue(); 
    101103 
  • dmd/func.c

    r957 r1103  
    338338 
    339339#if DMDV2 
    340         if (!isOverride() && global.params.warnings
    341             warning("%s: overrides base class function %s, but is not marked with 'override'", locToChars() fdv->toPrettyChars()); 
     340        if (!isOverride()
     341            warning(loc, "overrides base class function %s, but is not marked with 'override'", fdv->toPrettyChars()); 
    342342#endif 
    343343 
     
    10841084            {   Expression *e; 
    10851085 
    1086             if (global.params.warnings) 
    1087             {   warning("%s: no return at end of function", locToChars()); 
    1088             } 
     1086            warning(loc, "no return at end of function"); 
    10891087 
    10901088            if (global.params.useAssert && 
     
    10961094                  endloc, 
    10971095                  new IntegerExp(0), 
    1098                   new StringExp(loc, "missing return expression") 
     1096                  new StringExp(loc, (char *)"missing return expression") 
    10991097                ); 
    11001098            } 
     
    21662164    : FuncDeclaration(loc, endloc, NULL, STCundefined, type) 
    21672165{ 
    2168     char *id; 
     2166    const char *id; 
    21692167 
    21702168    if (fes) 
     
    23112309char *CtorDeclaration::toChars() 
    23122310{ 
    2313     return "this"; 
     2311    return (char *)"this"; 
    23142312} 
    23152313 
     
    26532651    if (!ad) 
    26542652    { 
    2655     error("invariants only are for struct/union/class definitions"); 
     2653    error("invariants are only for struct/union/class definitions"); 
    26562654    return; 
    26572655    } 
  • dmd/hdrgen.c

    r571 r1103  
    2525#endif 
    2626 
    27 #if IN_GCC || IN_LLVM 
    28 #include "mem.h" 
    29 #else 
    30 #if _WIN32 
    31 #include "..\root\mem.h" 
    32 #elif POSIX 
    33 #include "../root/mem.h" 
    34 #else 
    35 #error "fix this" 
    36 #endif 
    37 #endif 
     27#include "rmem.h" 
    3828 
    3929#include "id.h" 
  • dmd/identifier.c

    r817 r1103  
    9494 
    9595    buf.writestring(prefix); 
    96     buf.printf("%"PRIuSIZE, i); 
     96    buf.printf("%zu", i); 
    9797 
    9898    char *id = buf.toChars(); 
  • dmd/interpret.c

    r913 r1103  
    1313#include <assert.h> 
    1414 
    15 #include "mem.h" 
     15#include "rmem.h" 
    1616 
    1717#include "statement.h" 
     
    8181    { 
    8282    semantic3(scope); 
    83     if (global.errors)  // if errors compiling this function 
    84         return NULL; 
     83   if (global.errors)  // if errors compiling this function 
     84       return NULL; 
    8585    } 
    8686    if (semanticRun < 2) 
  • dmd/lexer.c

    r872 r1103  
    2121#include <stdlib.h> 
    2222#include <assert.h> 
     23#include <math.h> 
     24 
     25#if _MSC_VER 
     26#include <time.h> 
     27#else 
    2328#include <sys/time.h> 
    24 #include <math.h> 
     29#endif 
    2530 
    2631#ifdef IN_GCC 
    27  
    2832#include <time.h> 
    29 #include "mem.h" 
    30  
    31 #else 
    32  
    33 #if __GNUC__ 
     33#elif __GNUC__ 
    3434#include <time.h> 
    3535#endif 
    3636 
    37 #if IN_LLVM 
    38 #include "mem.h" 
    39 #elif _WIN32 
    40 #include "..\root\mem.h" 
    41 #else 
    42 #include "../root/mem.h" 
    43 #endif 
    44 #endif 
     37#include "rmem.h" 
    4538 
    4639#include "stringtable.h" 
     
    5548// from \dm\src\include\setlocal.h 
    5649extern "C" char * __cdecl __locale_decpoint; 
     50#endif 
     51 
     52#if _MSC_VER // workaround VC++ bug, labels and types should be in separate namespaces 
     53#define Lstring Lstr 
    5754#endif 
    5855 
     
    141138 
    142139    case TOKint64v: 
    143         sprintf(buffer,"%lldL",(long long)int64value); 
     140        sprintf(buffer,"%jdL",int64value); 
    144141        break; 
    145142 
    146143    case TOKuns64v: 
    147         sprintf(buffer,"%lluUL",(unsigned long long)uns64value); 
     144        sprintf(buffer,"%juUL",uns64value); 
    148145        break; 
    149146 
  • dmd/lstring.c

    r1 r1103  
    1212 
    1313#include "dchar.h" 
    14 #include "mem.h" 
     14#include "rmem.h" 
    1515#include "lstring.h" 
    1616 
  • dmd/macro.c

    r571 r1103  
    1717#include <assert.h> 
    1818 
    19 #if IN_GCC || IN_LLVM 
    20 #include "mem.h" 
    21 #else 
    22 #if _WIN32 
    23 #include "..\root\mem.h" 
    24 #elif POSIX 
    25 #include "../root/mem.h" 
    26 #else 
    27 #error "fix this" 
    28 #endif 
    29 #endif 
    30  
     19#include "rmem.h" 
    3120#include "root.h" 
     21 
    3222#include "macro.h" 
    3323 
  • dmd/man.c

    r879 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 2008-2008 by Digital Mars 
     3// Copyright (c) 2008-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    4242    browser = strdup(browser); 
    4343    else 
    44     browser = "firefox"; 
     44    browser = "x-www-browser"; 
    4545 
    4646    args[0] = browser; 
     
    9999 
    100100 
     101#if __FreeBSD__ 
     102#endif 
  • dmd/mangle.c

    r723 r1103  
    2424#include "id.h" 
    2525#include "module.h" 
     26 
     27#if TARGET_LINUX || TARGET_OSX 
     28char *cpp_mangle(Dsymbol *s); 
     29#endif 
    2630 
    2731char *mangle(Declaration *sthis) 
     
    111115        case LINKwindows: 
    112116        case LINKpascal: 
     117            return ident->toChars(); 
     118 
    113119        case LINKcpp: 
     120#if V2 && (TARGET_LINUX || TARGET_OSX) 
     121            return cpp_mangle(this); 
     122#else 
     123            // Windows C++ mangling is done by C++ back end 
    114124            return ident->toChars(); 
     125#endif 
    115126 
    116127        case LINKdefault: 
     
    143154    { 
    144155    if (isMain()) 
    145         return "_Dmain"; 
     156        return (char *)"_Dmain"; 
    146157 
    147158    if (isWinMain() || isDllMain()) 
     
    217228    buf.writestring(p); 
    218229    } 
    219     buf.printf("%"PRIuSIZE"%s", strlen(id), id); 
     230    buf.printf("%zu%s", strlen(id), id); 
    220231    id = buf.toChars(); 
    221232    buf.data = NULL; 
     
    244255    buf.writestring(p); 
    245256    } 
    246     buf.printf("%"PRIuSIZE"%s", strlen(id), id); 
     257    buf.printf("%zu%s", strlen(id), id); 
    247258    id = buf.toChars(); 
    248259    buf.data = NULL; 
     
    270281    buf.writestring(p); 
    271282    } 
    272     buf.printf("%"PRIuSIZE"%s", strlen(id), id); 
     283    buf.printf("%zu%s", strlen(id), id); 
    273284    id = buf.toChars(); 
    274285    buf.data = NULL; 
  • dmd/mars.c

    r1064 r1103  
    2626#endif 
    2727 
    28 #include "mem.h" 
     28#include "rmem.h" 
    2929#include "root.h" 
    3030 
     
    104104    verror(loc, format, ap); 
    105105    va_end( ap ); 
     106} 
     107 
     108void warning(Loc loc, const char *format, ...) 
     109{ 
     110    if (global.params.warnings && !global.gag) 
     111    { 
     112    fprintf(stdmsg, "warning - "); 
     113    va_list ap; 
     114    va_start(ap, format); 
     115    char* p = loc.toChars(); 
     116    fprintf(stdmsg, "Warning: %s:", p?p:""); 
     117    vfprintf(stdmsg, format, ap); 
     118    va_end( ap ); 
     119    } 
    106120} 
    107121 
  • dmd/mars.h

    r1064 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2007 by Digital Mars 
     3// Copyright (c) 1999-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    1414#ifdef __DMC__ 
    1515#pragma once 
    16 #endif /* __DMC__ */ 
     16#endif 
     17 
     18/* 
     19It is very important to use version control macros correctly - the 
     20idea is that host and target are independent. If these are done 
     21correctly, cross compilers can be built. 
     22The host compiler and host operating system are also different, 
     23and are predefined by the host compiler. The ones used in 
     24dmd are: 
     25 
     26Macros defined by the compiler, not the code: 
     27 
     28    Compiler: 
     29    __DMC__     Digital Mars compiler 
     30    _MSC_VER    Microsoft compiler 
     31    __GNUC__    Gnu compiler 
     32 
     33    Host operating system: 
     34    _WIN32      Microsoft NT, Windows 95, Windows 98, Win32s, 
     35            Windows 2000, Win XP, Vista 
     36    _WIN64      Windows for AMD64 
     37    linux       Linux 
     38    __APPLE__   Mac OSX 
     39 
     40For the target systems, there are the target operating system and 
     41the target object file format: 
     42 
     43    Target operating system: 
     44    TARGET_WINDOS   Covers 32 bit windows and 64 bit windows 
     45    TARGET_LINUX    Covers 32 and 64 bit linux 
     46    TARGET_OSX  Covers 32 and 64 bit Mac OSX 
     47 
     48    It is expected that the compiler for each platform will be able 
     49    to generate 32 and 64 bit code from the same compiler binary. 
     50 
     51    Target object module format: 
     52    OMFOBJ      Intel Object Module Format, used on Windows 
     53    ELFOBJ      Elf Object Module Format, used on linux 
     54    MACHOBJ     Mach-O Object Module Format, used on Mac OSX 
     55 
     56    There are currently no macros for byte endianness order. 
     57 */ 
     58 
    1759 
    1860#include <stdint.h> 
     
    3678#define DMDV2   0   // Version 2.0 features 
    3779#define BREAKABI 1  // 0 if not ready to break the ABI just yet 
     80#define STRUCTTHISREF V2    // if 'this' for struct is a reference, not a pointer 
     81 
     82/* Other targets are TARGET_LINUX and TARGET_OSX, which are 
     83 * set on the command line via the compiler makefile. 
     84 */ 
     85 
     86#if _WIN32 
     87#define TARGET_WINDOS 1     // Windows dmd generates Windows targets 
     88#define OMFOBJ 1 
     89#endif 
     90 
     91#if TARGET_LINUX 
     92#ifndef ELFOBJ 
     93#define ELFOBJ 1 
     94#endif 
     95#endif 
     96 
     97#if TARGET_OSX 
     98#ifndef MACHOBJ 
     99#define MACHOBJ 1 
     100#endif 
     101#endif 
     102 
    38103 
    39104struct Array; 
     
    91156    bool warnings;      // enable warnings 
    92157    char Dversion;  // D version number 
     158    char safe;      // enforce safe memory model 
    93159 
    94160    char *argv0;    // program name 
     
    118184    Array *debuglibnames;   // default libraries for debug builds 
    119185 
    120     char *xmlname;    // filename for XML output 
     186    const char *xmlname;  // filename for XML output 
    121187 
    122188    // Hidden debug switches 
     
    157223struct Global 
    158224{ 
    159     char *mars_ext; 
    160     char *sym_ext; 
    161     char *obj_ext; 
     225    const char *mars_ext; 
     226    const char *sym_ext; 
     227    const char *obj_ext; 
    162228#if _WIN32 
    163229    char *obj_ext_alt; 
     
    166232    char *bc_ext; 
    167233    char *s_ext; 
    168     char *doc_ext;  // for Ddoc generated files 
    169     char *ddoc_ext; // for Ddoc macro include files 
    170     char *hdr_ext;  // for D 'header' import files 
    171     char *copyright; 
    172     char *written; 
     234    const char *lib_ext; 
     235    const char *doc_ext;    // for Ddoc generated files 
     236    const char *ddoc_ext;   // for Ddoc macro include files 
     237    const char *hdr_ext;    // for D 'header' import files 
     238    const char *copyright; 
     239    const char *written; 
    173240    Array *path;    // Array of char*'s which form the import lookup path 
    174241    Array *filePath;    // Array of char*'s which form the file import lookup path 
    175242    int structalign; 
    176     char *version; 
     243    const char *version; 
    177244    char *ldc_version; 
    178245    char *llvm_version; 
     
    252319#endif 
    253320 
    254 // taken from GDC 
    255 // for handling printf incompatibilities 
    256 #if __MSVCRT__ 
    257 #define PRIuSIZE "Iu" 
    258 #define PRIxSIZE "Ix" 
    259 #elif __MINGW32__ 
    260 #define PRIuSIZE "u" 
    261 #define PRIxSIZE "x" 
    262 #else 
    263 #define PRIuSIZE "zu" 
    264 #define PRIxSIZE "zx" 
    265 #endif 
    266  
    267321struct Module; 
    268322 
     
    334388}; 
    335389 
     390void warning(Loc loc, const char *format, ...); 
    336391void error(Loc loc, const char *format, ...); 
    337392void verror(Loc loc, const char *format, va_list); 
  • dmd/mem.c

    r269 r1103  
    88#include <cassert> 
    99 
    10 #include "mem.h" 
     10#include "rmem.h" 
    1111 
    1212#if USE_BOEHM_GC 
  • dmd/module.c

    r986 r1103  
    2525#endif 
    2626 
    27 #include "mem.h" 
     27#include "rmem.h" 
    2828 
    2929#include "mars.h" 
     
    8989    strictlyneedmoduleinfo = 0; 
    9090#endif 
     91    selfimports = 0; 
    9192    insearch = 0; 
    9293    searchCacheIdent = NULL; 
     
    146147} 
    147148 
    148 File* Module::buildFilePath(char* forcename, char* path, char* ext) 
    149 { 
    150     char *argobj; 
     149File* Module::buildFilePath(const char* forcename, const char* path, const char* ext) 
     150{ 
     151    const char *argobj; 
    151152    if (forcename) 
    152153    argobj = forcename; 
     
    161162    { 
    162163        if(md) 
    163         argobj = FileName::replaceName(argobj, md->toChars()); 
     164        argobj = FileName::replaceName((char*)argobj, md->toChars()); 
    164165        else 
    165         argobj = FileName::replaceName(argobj, toChars()); 
     166        argobj = FileName::replaceName((char*)argobj, toChars()); 
    166167 
    167168        // add ext, otherwise forceExt will make nested.module into nested.bc 
     
    927928        mi->insearch = 1; 
    928929        int r = mi->imports(m); 
    929         mi->insearch = 0; 
    930930        if (r) 
    931931        return r; 
     
    934934    return FALSE; 
    935935} 
     936 
     937/************************************* 
     938 * Return !=0 if module imports itself. 
     939 */ 
     940 
     941int Module::selfImports() 
     942{ 
     943    //printf("Module::selfImports() %s\n", toChars()); 
     944    if (!selfimports) 
     945    { 
     946    for (int i = 0; i < amodules.dim; i++) 
     947    {   Module *mi = (Module *)amodules.data[i]; 
     948        //printf("\t[%d] %s\n", i, mi->toChars()); 
     949        mi->insearch = 0; 
     950    } 
     951 
     952    selfimports = imports(this) + 1; 
     953 
     954    for (int i = 0; i < amodules.dim; i++) 
     955    {   Module *mi = (Module *)amodules.data[i]; 
     956        //printf("\t[%d] %s\n", i, mi->toChars()); 
     957        mi->insearch = 0; 
     958    } 
     959    } 
     960    return selfimports - 1; 
     961} 
     962 
    936963 
    937964/* =========================== ModuleDeclaration ===================== */ 
  • dmd/module.h

    r1052 r1103  
    8080    int strictlyneedmoduleinfo; 
    8181#endif 
     82 
     83    int selfimports;        // 0: don't know, 1: does not, 2: does 
     84    int selfImports();      // returns !=0 if module imports itself 
    8285 
    8386    int insearch; 
     
    174177    llvm::Module* genLLVMModule(int multiobj); 
    175178    void buildTargetFiles(); 
    176     File* buildFilePath(char* forcename, char* path, char* ext); 
     179    File* buildFilePath(const char* forcename, const char* path, const char* ext); 
    177180    Module *isModule() { return this; } 
    178181     
  • dmd/mtype.c

    r1051 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2008 by Digital Mars 
     3// Copyright (c) 1999-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    5050#endif 
    5151 
    52 #include "mem.h" 
     52#include "rmem.h" 
    5353 
    5454#include "dsymbol.h" 
     
    214214    mangleChar[Ttuple] = 'B'; 
    215215    mangleChar[Tslice] = '@'; 
     216    mangleChar[Treturn] = '@'; 
    216217 
    217218    for (i = 0; i < TMAX; i++) 
     
    710711} 
    711712 
     713void Type::warning(Loc loc, const char *format, ...) 
     714{ 
     715    if (global.params.warnings && !global.gag) 
     716    { 
     717    fprintf(stdmsg, "warning - "); 
     718    va_list ap; 
     719    va_start(ap, format); 
     720    ::verror(loc, format, ap); 
     721    va_end( ap ); 
     722    } 
     723} 
     724 
    712725Identifier *Type::getTypeInfoIdent(int internal) 
    713726{ 
     
    722735    {   buf.writeByte(mangleChar[ty]); 
    723736    if (ty == Tarray) 
    724         buf.writeByte(mangleChar[next->ty]); 
     737        buf.writeByte(mangleChar[((TypeArray *)this)->next->ty]); 
    725738    } 
    726739    else 
     
    747760void Type::resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps) 
    748761{ 
    749     Type *t; 
    750  
    751     t = semantic(loc, sc); 
     762    //printf("Type::resolve() %s, %d\n", toChars(), ty); 
     763    Type *t = semantic(loc, sc); 
    752764    *pt = t; 
    753765    *pe = NULL; 
     
    18741886 
    18751887    dim = dim->optimize(WANTvalue | WANTinterpret); 
    1876     if (sc->parameterSpecialization && dim->op == TOKvar && 
     1888    if (sc && sc->parameterSpecialization && dim->op == TOKvar && 
    18771889        ((VarExp *)dim)->var->storage_class & STCtemplateparameter) 
    18781890    { 
     
    19101922        { 
    19111923          Loverflow: 
    1912         error(loc, "index %lld overflow for static array", d1); 
     1924        error(loc, "index %jd overflow for static array", d1); 
    19131925        dim = new IntegerExp(0, 1, tsize_t); 
    19141926        } 
     
    19241936 
    19251937        if (d >= tt->arguments->dim) 
    1926         {   error(loc, "tuple index %llu exceeds %u", d, tt->arguments->dim); 
     1938        {   error(loc, "tuple index %ju exceeds %u", d, tt->arguments->dim); 
    19271939        return Type::terror; 
    19281940        } 
     
    19451957    buf->writeByte(mangleChar[ty]); 
    19461958    if (dim) 
    1947     buf->printf("%llu", dim->toInteger()); 
     1959    buf->printf("%ju", dim->toInteger()); 
    19481960    if (next) 
    19491961    next->toDecoBuffer(buf); 
     
    26372649    printf("TypeReference::defaultInit() '%s'\n", toChars()); 
    26382650#endif 
    2639     Expression *e; 
    2640     e = new NullExp(loc); 
     2651    Expression *e = new NullExp(loc); 
    26412652    e->type = this; 
    26422653    return e; 
     
    37203731Type *TypeTypeof::syntaxCopy() 
    37213732{ 
     3733    //printf("TypeTypeof::syntaxCopy() %s\n", toChars()); 
    37223734    TypeTypeof *t; 
    37233735 
     
    39553967    if (!s) 
    39563968    { 
    3957     return getProperty(e->loc, ident); 
     3969    if (ident == Id::max || 
     3970        ident == Id::min || 
     3971        ident == Id::init || 
     3972        ident == Id::stringof || 
     3973        !sym->memtype 
     3974       ) 
     3975    { 
     3976        return getProperty(e->loc, ident); 
     3977    } 
     3978    return sym->memtype->dotExp(sc, e, ident); 
    39583979    } 
    39593980    m = s->isEnumMember(); 
     
    50395060    //printf("TypeTuple(this = %p)\n", this); 
    50405061    this->arguments = arguments; 
     5062    //printf("TypeTuple() %s\n", toChars()); 
    50415063#ifdef DEBUG 
    50425064    if (arguments) 
     
    50845106{ 
    50855107    //printf("TypeTuple::semantic(this = %p)\n", this); 
     5108    //printf("TypeTuple::semantic() %s\n", toChars()); 
    50865109    if (!deco) 
    50875110    deco = merge()->deco; 
     
    52075230 
    52085231    if (!(i1 <= i2 && i2 <= tt->arguments->dim)) 
    5209     {   error(loc, "slice [%llu..%llu] is out of range of [0..%u]", i1, i2, tt->arguments->dim); 
     5232    {   error(loc, "slice [%ju..%ju] is out of range of [0..%u]", i1, i2, tt->arguments->dim); 
    52105233    return Type::terror; 
    52115234    } 
     
    52525275 
    52535276        if (!(i1 <= i2 && i2 <= td->objects->dim)) 
    5254         {   error(loc, "slice [%llu..%llu] is out of range of [0..%u]", i1, i2, td->objects->dim); 
     5277        {   error(loc, "slice [%ju..%ju] is out of range of [0..%u]", i1, i2, td->objects->dim); 
    52555278        goto Ldefault; 
    52565279        } 
  • dmd/mtype.h

    r1051 r1103  
    3838struct Dsymbol; 
    3939struct TemplateInstance; 
     40struct CppMangleState; 
    4041enum LINK; 
    4142 
    4243struct TypeBasic; 
    4344struct HdrGenState; 
     45struct Argument; 
    4446 
    4547// Back end 
     
    100102    Ttuple, 
    101103    Tslice, 
    102  
     104    Treturn, 
    103105    TMAX 
    104106}; 
     
    109111extern int Tptrdiff_t; 
    110112 
     113 
    111114struct Type : Object 
    112115{ 
    113116    TY ty; 
    114     unsigned char mod;  // modifiers (MODconst, MODinvariant) 
     117    unsigned char mod;  // modifiers MODxxxx 
     118    /* pick this order of numbers so switch statements work better 
     119     */ 
    115120    #define MODconst     1  // type is const 
    116     #define MODinvariant 2    // type is invariant 
    117     Type *next; 
     121    #define MODinvariant 4    // type is invariant 
     122    #define MODshared    2  // type is shared 
    118123    char *deco; 
    119124    Type *pto;      // merged pointer to this type 
     
    243248    virtual Expression *toExpression(); 
    244249    virtual int hasPointers(); 
     250    Type *next; 
    245251    Type *nextOf() { return next; } 
    246252 
    247253    static void error(Loc loc, const char *format, ...); 
     254    static void warning(Loc loc, const char *format, ...); 
    248255 
    249256    // For backend 
  • dmd/opover.c

    r875 r1103  
    1919#endif 
    2020 
    21 #if IN_GCC || IN_LLVM 
    22 #include "mem.h" 
    23 #elif POSIX 
    24 #include "../root/mem.h" 
    25 #elif _WIN32 
    26 #include "..\root\mem.h" 
    27 #endif 
     21#include "rmem.h" 
    2822 
    2923//#include "port.h" 
     
    277271        } 
    278272    } 
    279  
     273     
    280274    lastf = m.lastf; 
    281275 
     
    577571        { 
    578572        fd = s->isFuncDeclaration(); 
    579         if (fd) 
     573        if (fd)  
    580574            inferApplyArgTypesX(fd, arguments); 
    581575        } 
  • dmd/optimize.c

    r1025 r1103  
    235235        integer_t dim = ts->dim->toInteger(); 
    236236        if (index < 0 || index >= dim) 
    237             error("array index %lld is out of bounds [0..%lld]", index, dim); 
     237            error("array index %jd is out of bounds [0..%jd]", index, dim); 
    238238        e = new SymOffExp(loc, ve->var, index * ts->next->size()); 
    239239        e->type = type; 
     
    422422        d_uns64 sz = e1->type->size() * 8; 
    423423        if (i2 < 0 || i2 > sz) 
    424         { 
    425         error("shift assign by %lld is outside the range 0..%"PRIuSIZE, i2, sz); 
     424        {   error("shift assign by %jd is outside the range 0..%zu", i2, sz); 
    426425        e2 = new IntegerExp(0); 
    427426        } 
     
    518517    d_uns64 sz = e->e1->type->size() * 8; 
    519518    if (i2 < 0 || i2 > sz) 
    520     { 
    521         error("shift by %lld is outside the range 0..%"PRIuSIZE, i2, sz); 
     519    {   e->error("shift by %jd is outside the range 0..%zu", i2, sz); 
    522520        e->e2 = new IntegerExp(0); 
    523521    } 
  • dmd/parse.c

    r846 r1103  
    1414#include <assert.h> 
    1515 
    16 #include "mem.h" 
     16#include "rmem.h" 
    1717#include "lexer.h" 
    1818#include "parse.h" 
  • dmd/root.c

    r872 r1103  
    11 
    2 // Copyright (c) 1999-2006 by Digital Mars 
     2// Copyright (c) 1999-2009 by Digital Mars 
    33// All Rights Reserved 
    44// written by Walter Bright 
     
    4141#include "root.h" 
    4242#include "dchar.h" 
    43 #include "mem.h" 
     43#include "rmem.h" 
    4444#include "mars.h" 
    4545 
     
    377377            continue; 
    378378 
     379#if MACINTOSH 
     380            case ',': 
     381#endif 
    379382#if _WIN32 
    380383            case ';': 
     
    13451348{ 
    13461349    if (offset > len || offset + nbytes > len) 
    1347     error("Corrupt file '%s': offset x%"PRIxSIZE" off end of file",toChars(),offset); 
     1350    error("Corrupt file '%s': offset x%zx off end of file",toChars(),offset); 
    13481351} 
    13491352 
     
    13861389void OutBuffer::reserve(unsigned nbytes) 
    13871390{ 
    1388   //printf("OutBuffer::reserve: size = %d, offset = %d, nbytes = %d\n", size, offset, nbytes); 
     1391    //printf("OutBuffer::reserve: size = %d, offset = %d, nbytes = %d\n", size, offset, nbytes); 
    13891392    if (size - offset < nbytes) 
    13901393    { 
    1391 #if defined (__x86_64__) 
    1392     size = (offset + nbytes) * 2+2; 
    1393 #else 
    13941394    size = (offset + nbytes) * 2; 
    1395 #endif 
    13961395    data = (unsigned char *)mem.realloc(data, size); 
    13971396    } 
  • dmd/root.h

    r658 r1103  
    3838 
    3939#if _MSC_VER 
     40#include <float.h>  // for _isnan 
    4041typedef __int64 longlong; 
    4142typedef unsigned __int64 ulonglong; 
  • dmd/scope.c

    r561 r1103  
    258258            sc->enclosing->search(loc, ident, NULL)) 
    259259        { 
    260             // WTF ? 
    261             if (global.params.warnings) 
    262             fprintf(stdmsg, "warning - "); 
    263             error(s->loc, "array 'length' hides other 'length' name in outer scope"); 
     260            warning(s->loc, "array 'length' hides other 'length' name in outer scope"); 
    264261        } 
    265262 
  • dmd/statement.c

    r945 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2008 by Digital Mars 
     3// Copyright (c) 1999-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    1313#include <assert.h> 
    1414 
    15 #include "mem.h" 
     15#include "rmem.h" 
    1616 
    1717#include "statement.h" 
     
    9595    ::verror(loc, format, ap); 
    9696    va_end( ap ); 
     97} 
     98 
     99void Statement::warning(const char *format, ...) 
     100{ 
     101    if (global.params.warnings && !global.gag) 
     102    { 
     103    fprintf(stdmsg, "warning - "); 
     104    va_list ap; 
     105    va_start(ap, format); 
     106    ::verror(loc, format, ap); 
     107    va_end( ap ); 
     108    } 
    97109} 
    98110 
     
    540552        if (!(result & BEfallthru) && !s->comeFrom()) 
    541553        { 
    542         if (global.params.warnings) 
    543         {   fprintf(stdmsg, "warning - "); 
    544             s->error("statement is not reachable"); 
    545         } 
     554        s->warning("statement is not reachable"); 
    546555        } 
    547556 
     
    10301039    if (init) 
    10311040    init = init->semantic(sc); 
     1041#if 0 
    10321042    if (!condition) 
    10331043    // Use a default value 
    10341044    condition = new IntegerExp(loc, 1, Type::tboolean); 
     1045#endif 
    10351046    sc->noctor++; 
    10361047    if (condition) 
     
    10971108    if (body) 
    10981109    {   int r = body->blockExit(); 
    1099     if (r & BEbreak
     1110    if (r & (BEbreak | BEgoto)
    11001111        result |= BEfallthru; 
    1101     result |= r & ~(BEbreak | BEcontinue); 
     1112    result |= r & ~(BEfallthru | BEbreak | BEcontinue); 
    11021113    } 
    11031114    if (increment && increment->canThrow()) 
     
    16701681        } 
    16711682        const char *r = (op == TOKforeach_reverse) ? "R" : ""; 
    1672         int j = sprintf(fdname, "_aApply%s%.*s%" PRIuSIZE, r, 2, fntab[flag], dim); 
     1683        int j = sprintf(fdname, "_aApply%s%.*s%zu", r, 2, fntab[flag], dim); 
    16731684        assert(j < sizeof(fdname)); 
    16741685        //LDC: Build arguments. 
     
    23242335    {   hasNoDefault = 1; 
    23252336 
    2326     if (global.params.warnings) 
    2327     {   warning("%s: switch statement has no default", loc.toChars()); 
    2328     } 
     2337    warning("switch statement has no default"); 
    23292338 
    23302339    // Generate runtime error if the default is hit 
     
    39313940    return this; 
    39323941} 
    3933  
    3934  
  • dmd/statement.h

    r945 r1103  
    8080struct code; 
    8181 
    82 /* How a statement exits 
     82/* How a statement exits; this is returned by blockExit() 
    8383 */ 
    8484enum BE 
     
    135135 
    136136    void error(const char *format, ...); 
     137    void warning(const char *format, ...); 
    137138    virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 
    138139    virtual TryCatchStatement *isTryCatchStatement() { return NULL; } 
  • dmd/stringtable.c

    r336 r1103  
    1414 
    1515#include "root.h" 
    16 #include "mem.h" 
     16#include "rmem.h" 
    1717#include "dchar.h" 
    1818#include "lstring.h" 
  • dmd/struct.c

    r1003 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2006 by Digital Mars 
     3// Copyright (c) 1999-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    4545    sinit = NULL; 
    4646    scope = NULL; 
     47#if V2 
     48    dtor = NULL; 
     49 
     50    ctor = NULL; 
     51    defaultCtor = NULL; 
     52#endif 
    4753} 
    4854 
     
    129135 */ 
    130136 
    131 void AggregateDeclaration::alignmember(unsigned salign, unsigned size, unsigned *poffset) 
    132 
    133     //printf("salign = %d, size = %d, offset = %d\n",salign,size,*poffset); 
     137void AggregateDeclaration::alignmember( 
     138    unsigned salign,    // struct alignment that is in effect 
     139    unsigned size,      // alignment requirement of field 
     140    unsigned *poffset) 
     141
     142    //printf("salign = %d, size = %d, offset = %d\n",salign,size,offset); 
    134143    if (salign > 1) 
    135     {   int sa; 
    136  
    137     switch (size) 
    138     {   case 1: 
    139         break; 
    140         case 2: 
    141         case_2: 
    142         *poffset = (*poffset + 1) & ~1; // align to word 
    143         break; 
    144         case 3: 
    145         case 4: 
    146         if (salign == 2) 
    147             goto case_2; 
    148         *poffset = (*poffset + 3) & ~3; // align to dword 
    149         break; 
    150         default: 
    151         *poffset = (*poffset + size - 1) & ~(size - 1); 
    152         break; 
    153     } 
    154     } 
    155     //printf("result = %d\n",*poffset); 
     144    { 
     145    assert(size != 3); 
     146    int sa = size; 
     147    if (sa == 0 || salign < sa) 
     148        sa = salign; 
     149    *poffset = (*poffset + sa - 1) & ~(sa - 1); 
     150    } 
     151    //printf("result = %d\n",offset); 
    156152} 
    157153 
     
    169165    if (t->ty == Tstruct /*&& isStructDeclaration()*/) 
    170166    {   TypeStruct *ts = (TypeStruct *)t; 
     167#if V2 
     168    if (ts->sym == this) 
     169    { 
     170        error("cannot have field %s with same struct type", v->toChars()); 
     171    } 
     172#endif 
    171173 
    172174    if (ts->sym->sizeok != 1) 
     
    208210{ 
    209211    zeroInit = 0;   // assume false until we do semantic processing 
     212#if V2 
     213    hasIdentityAssign = 0; 
     214    cpctor = NULL; 
     215    postblit = NULL; 
     216#endif 
    210217 
    211218    // For forward references 
     
    252259 
    253260    parent = sc->parent; 
     261#if STRUCTTHISREF 
     262    handle = type; 
     263#else 
    254264    handle = type->pointerTo(); 
     265#endif 
    255266    structalign = sc->structalign; 
    256267    protection = sc->protection; 
     
    260271    if (sc->stc & STCabstract) 
    261272    error("structs, unions cannot be abstract"); 
     273#if V2 
     274    if (storage_class & STCinvariant) 
     275        type = type->invariantOf(); 
     276    else if (storage_class & STCconst) 
     277        type = type->constOf(); 
     278#endif 
    262279 
    263280    if (sizeok == 0)        // if not already done the addMember step 
     
    352369    id = Id::cmp; 
    353370    } 
    354  
     371#if V2 
     372    dtor = buildDtor(sc2); 
     373    postblit = buildPostBlit(sc2); 
     374    cpctor = buildCpCtor(sc2); 
     375    buildOpAssign(sc2); 
     376#endif 
    355377 
    356378    sc2->pop(); 
     
    415437    /* Look for special member functions. 
    416438     */ 
     439#if V2 
     440    ctor =   (CtorDeclaration *)search(0, Id::ctor, 0); 
     441#endif 
    417442    inv =    (InvariantDeclaration *)search(0, Id::classInvariant, 0); 
    418443    aggNew =       (NewDeclaration *)search(0, Id::classNew,       0); 
  • dmd/template.c

    r1089 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2008 by Digital Mars 
     3// Copyright (c) 1999-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    2222 
    2323#include "root.h" 
    24 #include "mem.h" 
     24#include "rmem.h" 
    2525#include "stringtable.h" 
    2626#include "mars.h" 
     
    187187        goto Lnomatch; 
    188188    } 
     189#if V2 
     190    VarDeclaration *v1 = s1->isVarDeclaration(); 
     191    VarDeclaration *v2 = s2->isVarDeclaration(); 
     192    if (v1 && v2 && v1->storage_class & v2->storage_class & STCmanifest) 
     193    {   ExpInitializer *ei1 = v1->init->isExpInitializer(); 
     194        ExpInitializer *ei2 = v2->init->isExpInitializer(); 
     195        if (ei1 && ei2 && !ei1->exp->equals(ei2->exp)) 
     196        goto Lnomatch; 
     197    } 
     198#endif 
    189199    } 
    190200    else if (v1) 
     
    254264} 
    255265 
     266#if V2 
     267Object *objectSyntaxCopy(Object *o) 
     268{ 
     269    if (!o) 
     270    return NULL; 
     271    Type *t = isType(o); 
     272    if (t) 
     273    return t->syntaxCopy(); 
     274    Expression *e = isExpression(o); 
     275    if (e) 
     276    return e->syntaxCopy(); 
     277    return o; 
     278} 
     279#endif 
    256280 
    257281 
     
    280304    this->parameters = parameters; 
    281305    this->origParameters = parameters; 
     306#if V2 
     307    this->constraint = constraint; 
     308#endif 
    282309    this->members = decldefs; 
    283310    this->overnext = NULL; 
     
    304331    } 
    305332    } 
     333#if V2 
     334    Expression *e = NULL; 
     335    if (constraint) 
     336    e = constraint->syntaxCopy(); 
     337#endif 
    306338    d = Dsymbol::arraySyntaxCopy(members); 
    307339    td = new TemplateDeclaration(loc, ident, p, d); 
     
    353385    Scope *paramscope = sc->push(paramsym); 
    354386    paramscope->parameterSpecialization = 1; 
     387    paramscope->stc = 0; 
    355388 
    356389    if (global.params.doDocComments) 
     
    513546    paramsym->parent = scope->parent; 
    514547    Scope *paramscope = scope->push(paramsym); 
     548    paramscope->stc = 0; 
    515549 
    516550    // Attempt type deduction 
     
    764798 
    765799    for (i = 0; i < nargsi; i++) 
    766     {   TemplateParameter *tp = (TemplateParameter *)parameters->data[i]; 
     800    {   assert(i < parameters->dim); 
     801        TemplateParameter *tp = (TemplateParameter *)parameters->data[i]; 
    767802        MATCH m; 
    768803        Declaration *sparam; 
     
    801836        //printf("t = %p\n", t); 
    802837        dedargs->data[parameters->dim - 1] = (void *)t; 
     838        declareParameter(paramscope, tp, t); 
    803839        goto L2; 
    804840    } 
     
    836872            t->objects.data[i] = (void *)farg->type; 
    837873        } 
     874        declareParameter(paramscope, tp, t); 
    838875        goto L2; 
    839876        } 
     
    10211058            Declaration *sparam; 
    10221059            dedargs->data[i] = (void *)oded; 
    1023             MATCH m2 = tp->matchArg(paramscope, dedargs, i, parameters, &dedtypes, &sparam); 
     1060            MATCH m2 = tp->matchArg(paramscope, dedargs, i, parameters, &dedtypes, &sparam, 0); 
    10241061            //printf("m2 = %d\n", m2); 
    10251062            if (!m2) 
     
    10781115 
    10791116/************************************************** 
    1080  * Declare template parameter tp with value o
     1117 * Declare template parameter tp with value o, and install it in the scope sc
    10811118 */ 
    10821119 
     
    12611298    if (td_ambig) 
    12621299    { 
    1263     error(loc, "%s matches more than one function template declaration, %s and %s", 
    1264         toChars(), td_best->toChars(), td_ambig->toChars()); 
     1300    error(loc, "matches more than one function template declaration:\n  %s\nand:\n %s", 
     1301        td_best->toChars(), td_ambig->toChars()); 
    12651302    } 
    12661303 
     
    17951832        Expression *e2 = isExpression(o2); 
    17961833 
     1834        Dsymbol *s1 = isDsymbol(o1); 
     1835        Dsymbol *s2 = isDsymbol(o2); 
     1836 
     1837        Tuple *v1 = isTuple(o1); 
     1838        Tuple *v2 = isTuple(o2); 
    17971839#if 0 
    17981840        if (t1) printf("t1 = %s\n", t1->toChars()); 
     
    18001842        if (e1) printf("e1 = %s\n", e1->toChars()); 
    18011843        if (e2) printf("e2 = %s\n", e2->toChars()); 
     1844        if (s1) printf("s1 = %s\n", s1->toChars()); 
     1845        if (s2) printf("s2 = %s\n", s2->toChars()); 
     1846        if (v1) printf("v1 = %s\n", v1->toChars()); 
     1847        if (v2) printf("v2 = %s\n", v2->toChars()); 
    18021848#endif 
    18031849 
     
    18461892        } 
    18471893        } 
    1848         // BUG: Need to handle alias and tuple parameters 
     1894        else if (s1 && t2 && t2->ty == Tident) 
     1895        { 
     1896        j = templateParameterLookup(t2, parameters); 
     1897        if (j == -1) 
     1898            goto Lnomatch; 
     1899        TemplateParameter *tp = (TemplateParameter *)parameters->data[j]; 
     1900        // BUG: use tp->matchArg() instead of the following 
     1901        TemplateAliasParameter *ta = tp->isTemplateAliasParameter(); 
     1902        if (!ta) 
     1903            goto Lnomatch; 
     1904        Dsymbol *s = (Dsymbol *)dedtypes->data[j]; 
     1905        if (s) 
     1906        { 
     1907            if (!s1->equals(s)) 
     1908            goto Lnomatch; 
     1909        } 
     1910        else 
     1911        { 
     1912            dedtypes->data[j] = s1; 
     1913        } 
     1914        } 
     1915        else if (s1 && s2) 
     1916        { 
     1917        if (!s1->equals(s2)) 
     1918            goto Lnomatch; 
     1919        } 
     1920        // BUG: Need to handle tuple parameters 
    18491921        else 
    18501922        goto Lnomatch; 
     
    21142186MATCH TemplateTypeParameter::matchArg(Scope *sc, Objects *tiargs, 
    21152187    int i, TemplateParameters *parameters, Objects *dedtypes, 
    2116     Declaration **psparam
     2188    Declaration **psparam, int flags
    21172189{ 
    21182190    //printf("TemplateTypeParameter::matchArg()\n"); 
     
    23582430MATCH TemplateAliasParameter::matchArg(Scope *sc, 
    23592431    Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, 
    2360     Declaration **psparam
     2432    Declaration **psparam, int flags
    23612433{ 
    23622434    Dsymbol *sa; 
     
    25702642MATCH TemplateValueParameter::matchArg(Scope *sc, 
    25712643    Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, 
    2572     Declaration **psparam
     2644    Declaration **psparam, int flags
    25732645{ 
    25742646    //printf("TemplateValueParameter::matchArg()\n"); 
     
    27672839    Objects *tiargs, int i, TemplateParameters *parameters, 
    27682840    Objects *dedtypes, 
    2769     Declaration **psparam
     2841    Declaration **psparam, int flags
    27702842{ 
    27712843    //printf("TemplateTupleParameter::matchArg()\n"); 
     
    30273099    } 
    30283100 
    3029     isNested(tiargs); 
     3101    hasNestedArgs(tiargs); 
    30303102 
    30313103    /* See if there is an existing TemplateInstantiation that already 
     
    31023174    //if (scx && scx->scopesym) printf("3: scx is %s %s\n", scx->scopesym->kind(), scx->scopesym->toChars()); 
    31033175    if (scx && scx->scopesym && 
    3104         scx->scopesym->members && !scx->scopesym->isTemplateMixin() && 
    3105         /* The following test should really be if scx->module recursively 
    3106          * imports itself. Because if it does, see bugzilla 2500. 
     3176        scx->scopesym->members && !scx->scopesym->isTemplateMixin() 
     3177#if 1 // removed because it bloated compile times 
     3178        /* The problem is if A imports B, and B imports A, and both A 
     3179         * and B instantiate the same template, does the compilation of A 
     3180         * or the compilation of B do the actual instantiation? 
     3181         * 
     3182         * see bugzilla 2500. 
    31073183         */ 
    3108         //scx->module == tempdecl->getModule() 
    3109         !scx->module->imports(scx->module) 
     3184        && !scx->module->selfImports() 
     3185#endif 
    31103186       ) 
    31113187    { 
     
    31523228 
    31533229    // Declare each template parameter as an alias for the argument type 
    3154     declareParameters(scope); 
     3230    Scope *paramscope = scope->push(); 
     3231    paramscope->stc = 0; 
     3232    declareParameters(paramscope); 
     3233    paramscope->pop(); 
    31553234 
    31563235    // Add members of template instance to template instance symbol table 
     
    36213700 */ 
    36223701 
    3623 int TemplateInstance::isNested(Objects *args) 
     3702int TemplateInstance::hasNestedArgs(Objects *args) 
    36243703{   int nested = 0; 
    3625     //printf("TemplateInstance::isNested('%s')\n", tempdecl->ident->toChars()); 
     3704    //printf("TemplateInstance::hasNestedArgs('%s')\n", tempdecl->ident->toChars()); 
    36263705 
    36273706    /* A nested instance happens when an argument references a local 
     
    36923771    else if (va) 
    36933772    { 
    3694         nested |= isNested(&va->objects); 
     3773        nested |= hasNestedArgs(&va->objects); 
    36953774    } 
    36963775    } 
     
    37113790    //printf("TemplateInstance::genIdent('%s')\n", tempdecl->ident->toChars()); 
    37123791    id = tempdecl->ident->toChars(); 
    3713     buf.printf("__T%"PRIuSIZE"%s", strlen(id), id); 
     3792    buf.printf("__T%zu%s", strlen(id), id); 
    37143793    args = tiargs; 
    37153794    for (int i = 0; i < args->dim; i++) 
     
    37783857        { 
    37793858        char *p = sa->mangle(); 
    3780         buf.printf("%"PRIuSIZE"%s", strlen(p), p); 
     3859       buf.printf("%zu%s", strlen(p), p); 
    37813860        } 
    37823861    } 
  • dmd/template.h

    r1067 r1103  
    11 
    22// Compiler implementation of the D programming language 
    3 // Copyright (c) 1999-2008 by Digital Mars 
     3// Copyright (c) 1999-2009 by Digital Mars 
    44// All Rights Reserved 
    55// written by Walter Bright 
     
    138138    /* Match actual argument against parameter. 
    139139     */ 
    140     virtual MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam) = 0; 
     140    virtual MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam, int flags = 0) = 0; 
    141141 
    142142    /* Create dummy argument based on parameter. 
     
    164164    Object *defaultArg(Loc loc, Scope *sc); 
    165165    int overloadMatch(TemplateParameter *); 
    166     MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam); 
     166    MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam, int flags); 
    167167    void *dummyArg(); 
    168168}; 
     
    208208    Object *defaultArg(Loc loc, Scope *sc); 
    209209    int overloadMatch(TemplateParameter *); 
    210     MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam); 
     210    MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam, int flags); 
    211211    void *dummyArg(); 
    212212}; 
     
    236236    Object *defaultArg(Loc loc, Scope *sc); 
    237237    int overloadMatch(TemplateParameter *); 
    238     MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam); 
     238    MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam, int flags); 
    239239    void *dummyArg(); 
    240240}; 
     
    257257    Object *defaultArg(Loc loc, Scope *sc); 
    258258    int overloadMatch(TemplateParameter *); 
    259     MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam); 
     259    MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam, int flags); 
    260260    void *dummyArg(); 
    261261}; 
     
    319319    TemplateDeclaration *findBestMatch(Scope *sc); 
    320320    void declareParameters(Scope *sc); 
    321     int isNested(Objects *tiargs); 
     321    int hasNestedArgs(Objects *tiargs); 
    322322    Identifier *genIdent(); 
    323323 
  • gen/asmstmt.cpp

    r1102 r1103  
    470470        size_t pos = insnt.find(needle); 
    471471        if(std::string::npos != pos) 
    472             sprintf(buf, "%" PRIuSIZE, idx++); 
     472            sprintf(buf, "%lu", idx++); 
    473473        while(std::string::npos != (pos = insnt.find(needle))) 
    474474            insnt.replace(pos, needle.size(), buf); 
     
    495495        size_t pos = insnt.find(needle); 
    496496        if(std::string::npos != pos) 
    497             sprintf(buf, "%" PRIuSIZE, idx++); 
     497            sprintf(buf, "%lu", idx++); 
    498498        while(std::string::npos != (pos = insnt.find(needle))) 
    499499            insnt.replace(pos, needle.size(), buf); 
  • gen/cl_helpers.cpp

    r1063 r1103  
    22 
    33#include "root.h" 
    4 #include "mem.h" 
     4#include "rmem.h" 
    55 
    66#include <cctype>       // isupper, tolower 
  • gen/main.cpp

    r1073 r1103  
    2222#endif 
    2323 
    24 #include "mem.h" 
     24#include "rmem.h" 
    2525#include "root.h" 
    2626 
     
    3939#include "gen/cl_helpers.h" 
    4040using namespace opts; 
     41 
     42#include "gen/configfile.h" 
    4143 
    4244extern void getenv_setargv(const char *envvar, int *pargc, char** *pargv); 
     
    145147#endif 
    146148 
    147  
    148     // read the inifile 
    149 #if DMDV2 
    150     inifile(global.params.argv0, "ldc2.conf"); 
    151 #else 
    152     inifile(global.params.argv0, "ldc.conf"); 
    153 #endif 
    154  
    155     // merge DFLAGS into argc/argv 
     149    // merge DFLAGS environment variable into argc/argv 
    156150    getenv_setargv("DFLAGS", &argc, &argv); 
    157151#if 0 
     
    162156#endif 
    163157 
     158    // build complete fixed up list of command line arguments 
     159    std::vector<const char*> final_args; 
     160    final_args.reserve(argc); 
     161 
     162    // insert argc + DFLAGS 
     163    final_args.insert(final_args.end(), &argv[0], &argv[argc]); 
     164 
     165    // read the configuration file 
     166    ConfigFile cfg_file; 
     167 
     168    // just ignore errors for now, they are still printed 
     169#if DMDV2 
     170#define CFG_FILENAME "ldc2.conf" 
     171#else 
     172#define CFG_FILENAME "ldc.conf" 
     173#endif 
     174    cfg_file.read(global.params.argv0, (void*)main, CFG_FILENAME); 
     175#undef CFG_FILENAME 
     176 
     177    // insert config file additions to the argument list 
     178    final_args.insert(final_args.end(), cfg_file.switches_begin(), cfg_file.switches_end()); 
     179 
     180#if 0 
     181    for (size_t i = 0; i < final_args.size(); ++i) 
     182    { 
     183        printf("final_args[%zu] = %s\n", i, final_args[i]); 
     184    } 
     185#endif 
     186 
    164187    // Handle fixed-up arguments! 
    165188    cl::SetVersionPrinter(&printVersion); 
    166     cl::ParseCommandLineOptions(argc, argv, "LLVM-based D Compiler\n"); 
     189    cl::ParseCommandLineOptions(final_args.size(), (char**)&final_args[0], "LLVM-based D Compiler\n", true); 
    167190 
    168191    global.params.optimize = (global.params.optimizeLevel >= 0); 
  • gen/statements.cpp

    r1051 r1103  
    1010 
    1111#include "mars.h" 
    12 #include "total.h" 
    1312#include "init.h" 
    1413#include "mtype.h" 
  • gen/toir.cpp

    r1036 r1103  
    1414 
    1515#include "attrib.h" 
    16 #include "total.h" 
    1716#include "init.h" 
    1817#include "mtype.h" 
     
    2019#include "hdrgen.h" 
    2120#include "port.h" 
    22 #include "mem.h" 
     21#include "rmem.h" 
     22#include "id.h" 
     23#include "enum.h" 
    2324 
    2425#include "gen/irstate.h" 
  • ldc.conf.in

    r986 r1103  
    1 [Environment] 
    2 DFLAGS=-I@RUNTIME_DIR@ -I@RUNTIME_DIR@/lib/common -L-L%@P%/../lib -d-version=Tango -defaultlib=@RUNTIME_AIO@ -debuglib=@RUNTIME_AIO@ 
     1// This configuration file uses libconfig. 
     2// See http://www.hyperrealm.com/libconfig/ for syntax details. 
     3 
     4// The default group is required 
     5default: 
     6
     7    // 'switches' holds array of string that are appends to the command line 
     8    // arguments before they are parsed. 
     9    // {#} is replaced with the path to the directory holding the executable 
     10    switches = [ 
     11        "-I@RUNTIME_DIR@", 
     12        "-I@RUNTIME_DIR@/lib/common", 
     13        "-L-L@PROJECT_BINARY_DIR@/../lib", 
     14        "-d-version=Tango", 
     15        "-defaultlib=@RUNTIME_AIO@" 
     16    ]; 
     17}; 
Copyright © 2008, LDC Development Team.