Don't reverse order of object file names

Make sure the overall order corresponds to the user's command-line order
of object and source files. The only exception being singleObj builds,
for which the single object file for all source files is always the first
entry in the object files list (which is forwarded to the linker in that
order). This is done so that we can easily get hold of the name when
emitting the single object file later in the `ldc::CodeGenerator` dtor.
It should also clearly define the linking order (affecting comdat
selections etc.) for special singleObj builds.

Also reuse some more code (wrt. output filenames) from DMD's main().
This commit is contained in:
Martin 2016-09-17 22:42:50 +02:00
parent 1c82c405d6
commit b1a6315ee4
7 changed files with 96 additions and 97 deletions

View file

@ -39,7 +39,6 @@ private:
int moduleCount_;
bool const singleObj_;
IRState *ir_;
const char *firstModuleObjfileName_;
};
}