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.
Print DMD's logo with more debug information and error-reporting pointers.
FILE* stream
| output stream to print the information on |
DMD's entry point, C main.
Without -lowmem
, we need to switch to the bump-pointer allocation scheme right from the start, before any module ctors are run, so we need this hook before druntime is initialized and _Dmain
is called.
Manual D main (for druntime initialization), which forwards to tryMain
.
Parses an environment variable containing command-line flags and append them to args
.
This function is used to read the content of DFLAGS. Flags are separated based on spaces and tabs.
const(char)* envvalue
| The content of an environment variable |
Strings* args
| Array to append the flags to, if any. |
Parse command line arguments for the last instance of -m32, -m64 or -m32mscoff to detect the desired architecture.
Strings* args
| Command line arguments |
const(char)* arch
| Default value to use for architecture. Should be "32" or "64" |
arch
.Parse command line arguments for the last instance of -conf=path.
Strings* args
| Command line arguments |
Set the is
target fields of params
according to the TARGET value.
Param params
| where the is fields are |
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).
Param params
| which target to compile for (set by setTarget() ) |
we want to write the mixin expansion file also on error, but there are too many ways to terminate dmd (e.g. fatal() which calls exit(EXIT_FAILURE)), so we can't rely on scope(exit) ... in tryMain() actually being executed so we add atexit(&flushMixins); for those fatal exits (with the GC still valid)
Parse command line arguments.
Prints message(s) if there are errors.
Strings arguments
| command line arguments |
size_t argc
| argument count |
Param params
| set to result of parsing arguments
|
Strings files
| set to files pulled from arguments
|
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.
Strings files
| File names to dispatch |
Strings libmodules
| Array to which binaries (shared/static libs and object files) will be appended |
© 1999–2019 The D Language Foundation
Licensed under the Boost License 1.0.
https://dlang.org/phobos/dmd_mars.html