dmd.globals
Stores command line options and contains other miscellaneous declarations.
License
Source: globals.d
Documentation: https://dlang.org/phobos/dmd_globals.html
-
Declaration
enumDiagnosticReporting: ubyte; -
Declaration
enumMessageStyle: ubyte;How code locations are formatted for diagnostic reporting
-
Declaration
digitalmarsfilename.d(line): message
-
Declaration
gnufilename.d:line: message, see https://www.gnu.org/prep/standards/html_node/Errors.html
-
-
Declaration
enumCHECKENABLE: ubyte; -
Declaration
enumCHECKACTION: ubyte; -
Declaration
enumJsonFieldFlags: uint;Each flag represents a field that can be included in the JSON output.
NOTE: set type to uint so its size matches C++ unsigned type
-
Declaration
enumCppStdRevision: uint;Version of C++ standard to support
-
Declaration
enumFeatureState: byte; -
Declaration
structParam;Put command line switches in here
-
Declaration
structGlobal;Collection of global compiler settings and global state used by the frontend
-
Declaration
const(char)[]inifilename;filename of configuration file as given by
-conf=, or default value -
Declaration
Array!(const(char)*)*path;Array of char*'s which form the import lookup
path -
Declaration
Array!(const(char)*)*filePath;Array of char*'s which form the file import lookup path
-
Declaration
const(char)[]vendor;Compiler backend name
-
Declaration
Paramparams;command line parameters
-
Declaration
uinterrors;number of
errorsreported so far -
Declaration
uintwarnings;number of
warningsreported so far -
Declaration
uintgag;!=0 means
gagreporting of errors & warnings -
Declaration
uintgaggedErrors;number of errors reported while gagged
-
Declaration
uintgaggedWarnings;number of warnings reported while gagged
-
Declaration
void*console;opaque pointer to
consolefor controlling text attributes -
Declaration
Array!Identifier*versionids;command line versions and predefined versions
-
Declaration
Array!Identifier*debugids;command line debug versions and predefined versions
-
Declaration
boolhasMainFunction;Whether a main function has already been compiled in (for -main switch)
-
Declaration
uintvarSequenceNumber;Relative lifetime of
VarDeclarationwithin a function, used forscopechecks -
Declaration
FileManagerfileManager;Cache files read from disk
-
Declaration
enum intrecursionLimit;number of recursive template expansions before abort
-
Declaration
nothrow uintstartGagging();Start ignoring compile errors instead of reporting them.
Discussion
Used for speculative compilation like
__traits(compiles, XXX), but also internally to e.g. try out analias thisrewrite without comitting to it.
Works like a stack, so N calls toshould be paired with N calls tostartGaggingendGagging.Return Value
the current number of gagged errors, which should later be passed to
endGagging -
Declaration
nothrow boolendGagging(uintoldGagged);Stop gagging, restoring the old gagged state before the most recent call to
startGagging.Parameters
uintoldGaggedthe previous number of errors, as returned by
startGaggingReturn Value
trueif errors occurred while gagged. -
Declaration
nothrow voidincreaseErrorCount();Increment the error count to record that an error has occurred in the current context.
Discussion
An error message may or may not have been printed.
-
Declaration
nothrow voiddeinitialize();Deinitializes the global state of the compiler.
Discussion
This can be used to restore the state set by
_initto its original state. -
Declaration
nothrow uintversionNumber();Return Value
the version as the number that would be returned for __VERSION__
-
Declaration
nothrow stringversionString();Return Value
compiler version string.
-
Declaration
nothrow const(char*)versionChars();Return Value
compiler version as char string.
-
-
Declaration
structLoc;A source code location
Discussion
Used for error messages,
__FILE__and__LINE__tokens,__traits(getLocation, XXX), debug info etc.-
Declaration
const(char)*filename;zero-terminated
filenamestring, either absolute or relative to cwd -
Declaration
uintlinnum;line number, starting from 1
-
Declaration
uintcharnum;utf8 code unit index relative to start of line, starting from 1
-
Declaration
static immutable Locinitial;use for default initialization of const ref Loc's
-
Declaration
const nothrow boolequals(ref const(Loc)loc);Checks for equivalence by comparing the filename contents (not the pointer) and character location.
Note:
- Uses case-insensitive comparison on Windows
- Ignores
charnumifglobal.params.showColumnsisfalse.
-
Declaration
const pure nothrow @nogc @trusted boolopEquals(ref const(Loc)loc);
const pure nothrow @trusted size_ttoHash();/opEquals()for AA key usagetoHash()Discussion
Compare filename contents (case-sensitively on Windows too), not the pointer - a static foreach loop repeatedly mixing in a mixin may lead to multiple equivalent filenames (
foo.d-mixin-<line>), e.g., for test/runnable/test18880.d. -
Declaration
const pure nothrow boolisValid();Return Value
trueif Loc has been set to other than the default initialization
-
-
Declaration
Globalglobal;Collection of
globalstate