Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

dmd.mars

Compiler implementation of the D programming language. Entry point for DMD.
This modules defines the entry point (main) for DMD, as well as related utilities needed for arguments parsing, path manipulation, etc... This file is not shared with other compilers which use the DMD front-end.
Authors:

Source mars.d

void printInternalFailure(FILE* stream);
Print DMD's logo with more debug information and error-reporting pointers.
Parameters:
FILE* stream output stream to print the information on
int main();
Entry point which forwards to tryMain.
Returns:
Return code of the application
void setTarget(ref Param params);
Set the is target fields of params according to the TARGET value.
Parameters:
Param params where the is fields are
void addDefaultVersionIdentifiers(ref const Param params);
Add default version identifier for dmd, and set the target platform in params. https://dlang.org/spec/version.html#predefined-versions
Needs to be run after all arguments parsing (command line, DFLAGS environment variable and config file) in order to add final flags (such as X86_64 or the CRuntime used).
Parameters:
Param params which target to compile for (set by setTarget())
Modules createModules(ref Strings files, ref Strings libmodules);
Creates the list of modules based on the files provided
Files are dispatched in the various arrays (global.params.{ddocfiles,dllfiles,jsonfiles,etc...}) according to their extension. Binary files are added to libmodules.
Parameters:
Strings files File names to dispatch
Strings libmodules Array to which binaries (shared/static libs and object files) will be appended
Returns:
An array of path to D modules