Changeset 2169 for trunk/tools

Show
Ignore:
Timestamp:
11/16/10 15:39:33 (2 years ago)
Author:
rsinfu
Message:

Fixed bug 5133: dmd fails to build rdmd (problem with startsWith).

Also replaced invariant -> immutable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/rdmd.d

    r1400 r2169  
    129129 
    130130    // Compute the object directory and ensure it exists 
    131     invariant objDir = getObjPath(root, compilerFlags); 
     131    immutable objDir = getObjPath(root, compilerFlags); 
    132132    if (!dryRun)        // only make a fuss about objDir on a real run 
    133133    { 
     
    172172                (myModules.keys).length) 
    173173    { 
    174         invariant result = rebuild(root, exe, objDir, myModules, compilerFlags, 
     174        immutable result = rebuild(root, exe, objDir, myModules, compilerFlags, 
    175175                                   addStubMain); 
    176176        if (result) return result; 
     
    181181} 
    182182 
    183 bool inALibrary(in string source, in string object) 
     183bool inALibrary(string source, in string object) 
    184184{ 
    185185    // Heuristics: if source starts with "std.", it's in a library 
     
    221221    context.update(getcwd); 
    222222    context.update(root); 
    223     foreach (flag; compilerFlags) { 
     223    foreach (string flag; compilerFlags) { 
    224224        if (find(irrelevantSwitches, flag).length) continue; 
    225225        context.update(flag); 
     
    261261    } 
    262262     
    263     invariant result = run(todo); 
     263    immutable result = run(todo); 
    264264    if (result)  
    265265    { 
     
    299299    string[string] myModules;// = [ rootModule : d2obj(rootModule) ]; 
    300300    // Must collect dependencies 
    301     invariant depsGetter = /*"cd "~shellQuote(rootDir)~" && " 
     301    immutable depsGetter = /*"cd "~shellQuote(rootDir)~" && " 
    302302                             ~*/compiler~" "~join(compilerFlags, " ") 
    303303        ~" -v -o- "~shellQuote(rootModule) 
     
    321321    { 
    322322        if (!pattern.test(line)) continue; 
    323         invariant moduleName = pattern[1], moduleSrc = pattern[2]; 
     323        immutable moduleName = pattern[1], moduleSrc = pattern[2]; 
    324324        if (inALibrary(moduleName, moduleSrc)) continue; 
    325         invariant moduleObj = d2obj(moduleSrc); 
     325        immutable moduleObj = d2obj(moduleSrc); 
    326326        myModules[/*rel2abs*/join(rootDir, moduleSrc)] = moduleObj; 
    327327    }