CompilationContext

struct CompilationContext {}

Members

Aliases

findFunction
alias findFunction = findFunctionImpl!true
Undocumented in source.
tryFindFunction
alias tryFindFunction = findFunctionImpl!false
Undocumented in source.

Functions

addDllModuleSymbol
LinkIndex addDllModuleSymbol(LinkIndex dllModuleIndex, Identifier symId)
Undocumented in source. Be warned that the author may not have intended to support it.
addHostSymbol
LinkIndex addHostSymbol(LinkIndex hostModuleIndex, Identifier symId, void* symPtr)
Undocumented in source. Be warned that the author may not have intended to support it.
allocateTempArray
T[] allocateTempArray(uint howMany)
Undocumented in source. Be warned that the author may not have intended to support it.
appendAst
AstIndex appendAst(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
appendScope
ScopeIndex appendScope()
Undocumented in source. Be warned that the author may not have intended to support it.
appendTemp
IrIndex appendTemp(uint howMany)
Undocumented in source. Be warned that the author may not have intended to support it.
assertf
void assertf(bool cond, TokenIndex tokIdx, string fmt, Args args, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
assertf
void assertf(bool cond, string fmt, Args args, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
basicTypeNodes
AstIndex basicTypeNodes(BasicType basicType)
Undocumented in source. Be warned that the author may not have intended to support it.
beginCompilation
void beginCompilation()
Undocumented in source. Be warned that the author may not have intended to support it.
begin_node_property_calculation
void begin_node_property_calculation(T* node, NodeProperty prop)
Undocumented in source. Be warned that the author may not have intended to support it.
builtinNodes
AstIndex builtinNodes(BuiltinId builtinId)
Undocumented in source. Be warned that the author may not have intended to support it.
c
auto c()
Undocumented in source. Be warned that the author may not have intended to support it.
circular_dependency
noreturn circular_dependency(AstIndex nodeIndex, NodeProperty prop, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
circular_dependency
noreturn circular_dependency(string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
conciseErrors
bool conciseErrors()
Undocumented in source. Be warned that the author may not have intended to support it.
defaultCallConvention
CallConvention defaultCallConvention()
Undocumented in source. Be warned that the author may not have intended to support it.
end_node_property_calculation
void end_node_property_calculation(T* node, NodeProperty prop)
Undocumented in source. Be warned that the author may not have intended to support it.
error
void error(TokenIndex tokIdx, string format, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
error
void error(string format, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
findFunctionImpl
FunctionDeclNode* findFunctionImpl(Identifier funcId)
Undocumented in source. Be warned that the author may not have intended to support it.
findUniquelyNamedFunction
FunctionDeclNode* findUniquelyNamedFunction(Identifier funcId)
Undocumented in source. Be warned that the author may not have intended to support it.
freeTempArray
void freeTempArray(T[] array)
Undocumented in source. Be warned that the author may not have intended to support it.
getAst
T* getAst(AstIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getAstExpr
ExpressionNode* getAstExpr(AstIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getAstNode
AstNode* getAstNode(AstIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getAstNodeIndex
AstIndex getAstNodeIndex(T* node)
Undocumented in source. Be warned that the author may not have intended to support it.
getAstScope
Scope* getAstScope(ScopeIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getAstType
TypeNode* getAstType(AstIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getFileFromToken
SourceFileInfo* getFileFromToken(TokenIndex tokIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
getFunction
FunctionDeclNode* getFunction(IrIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getFunctionPtr
auto getFunctionPtr(FunctionDeclNode* funcDecl)
Undocumented in source. Be warned that the author may not have intended to support it.
getModule
ModuleDeclNode* getModule(ModuleIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getModuleFromToken
ModuleDeclNode* getModuleFromToken(TokenIndex tokIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
getOrCreateExternalModule
LinkIndex getOrCreateExternalModule(Identifier modId, ObjectModuleKind modKind)

Returns index of external (host or dll) module

getTemp
T getTemp(IrIndex index)
Undocumented in source. Be warned that the author may not have intended to support it.
getTokenString
const(char)[] getTokenString(TokenIndex tokenIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
get_file_name_constant
IrIndex get_file_name_constant(AstIndex mod)
Undocumented in source. Be warned that the author may not have intended to support it.
get_function_name_constant
IrIndex get_function_name_constant(AstIndex func)
Undocumented in source. Be warned that the author may not have intended to support it.
get_module_name_constant
IrIndex get_module_name_constant(AstIndex mod)
Undocumented in source. Be warned that the author may not have intended to support it.
idString
string idString(Identifier id)

Only returns self string

initialize
void initialize()
Undocumented in source. Be warned that the author may not have intended to support it.
internal_error
noreturn internal_error(TokenIndex tokIdx, string format, Args args, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
internal_error
noreturn internal_error(string format, Args args, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
popVmStack
void popVmStack(IrVmSlotInfo slot)
Undocumented in source. Be warned that the author may not have intended to support it.
pop_analized_node
void pop_analized_node()
Undocumented in source. Be warned that the author may not have intended to support it.
printDumpOf
bool printDumpOf(FunctionDeclNode* fun)

Check if printing of this function needed (including if all functions are requested)

printDumpOfAll
bool printDumpOfAll()

Check if printing of all functions requested

printDumpOnlyOf
bool printDumpOnlyOf(FunctionDeclNode* fun)

Check if printing of this function only is needed (not all functions)

printMemSize
void printMemSize(TextSink sink)
Undocumented in source. Be warned that the author may not have intended to support it.
printMemSize
void printMemSize()
Undocumented in source. Be warned that the author may not have intended to support it.
pushVmStack
IrVmSlotInfo pushVmStack(uint numBytes)
Undocumented in source. Be warned that the author may not have intended to support it.
push_analized_node
void push_analized_node(AnalysedNode item)
Undocumented in source. Be warned that the author may not have intended to support it.
setDumpFilter
void setDumpFilter(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
throwOnErrors
void throwOnErrors(string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
todo
void todo(string format, Args args, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
tokenLoc
SourceLocation tokenLoc(TokenIndex tokenIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
tryFindUniquelyNamedFunction
FunctionDeclNode* tryFindUniquelyNamedFunction(Identifier funcId)
Undocumented in source. Be warned that the author may not have intended to support it.
unreachable
noreturn unreachable(string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
unrecoverable_error
noreturn unrecoverable_error(TokenIndex tokIdx, string format, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

analisysStack
Array!AnalysedNode analisysStack;
Undocumented in source.
arrayArena
ArrayArena arrayArena;

For arrays and hashmaps used in AST nodes

astBuffer
Arena!uint astBuffer;

For AST nodes

binaryBuffer
Arena!ubyte binaryBuffer;

Buffer for output file generation (.exe)

buildDebug
bool buildDebug;

If true attempt to maximize debuggability

buildType
BuildType buildType;
builtinModuleIndex
LinkIndex builtinModuleIndex;
Undocumented in source.
builtinSections
LinkIndex[NUM_BUILTIN_SECTIONS] builtinSections;
Undocumented in source.
bundleBuffer
Arena!ubyte bundleBuffer;

Buffer for output file generation (.har)

bundleInputs
bool bundleInputs;
Undocumented in source.
codeBuffer
Arena!ubyte codeBuffer;

Buffer for resulting machine code

constants
IrConstantStorage constants;

Global constant storage

currentFunction
FunctionDeclNode* currentFunction;
Undocumented in source.
debugRegAlloc
bool debugRegAlloc;
Undocumented in source.
disableDCE
bool disableDCE;
Undocumented in source.
disableInline
bool disableInline;
Undocumented in source.
enabledVersionIdentifiers
uint enabledVersionIdentifiers;
Undocumented in source.
entryPoint
FunctionDeclNode* entryPoint;

Set when BuildType.exe is used Set in CodeEmitter.compileFunction

errorSink
TextSink errorSink;

Text output for errors

externalModules
HashMap!(Identifier, LinkIndex, Identifier.init) externalModules;

External modules that are provided by driver or created at runtime from @extern(module) dll functions

externalSymbols
HashMap!(ExternalSymbolId, LinkIndex, ExternalSymbolId.init) externalSymbols;

Symbols provided by the environment (host symbols must be provided prior to compilation) Symbols imported from dll that are demanded by functions marked with @extern(module)

extraProperties
HashMap!(ExtraNodeProperty, uint, ExtraNodeProperty.init) extraProperties;
Undocumented in source.
files
Arena!SourceFileInfo files;

Source file info storage

globals
IrGlobalStorage globals;

Module global values and literals.

hasErrors
bool hasErrors;

True if current/last pass had errors

hostOS
enum TargetOs hostOS;

Host OS

hostOS
enum TargetOs hostOS;
Undocumented in source.
hostOS
enum TargetOs hostOS;
Undocumented in source.
i64PtrType
IrIndex i64PtrType;
Undocumented in source.
i8PtrType
IrIndex i8PtrType;
Undocumented in source.
iceBehavior
IceBehavior iceBehavior;

What happens on Internal Compiler Error

idMap
IdentifierMap idMap;

Identifier interning/deduplication

importBuffer
Arena!ubyte importBuffer;

Buffer for indirect addresses when in JIT mode Buffer for import section when in exe mode

initializedTokenLocBufSize
size_t initializedTokenLocBufSize;
Undocumented in source.
irStorage
IrFuncStorage irStorage;

Buffer for function IR generation

machineInfo
MachineInfo* machineInfo;

Target machine info

modules
HashMap!(Identifier, AstIndex, Identifier.init) modules;

Vox modules and packages

numCtfeRuns
uint numCtfeRuns;
Undocumented in source.
numLinesLexed
uint numLinesLexed;
Undocumented in source.
numTemplateInstanceLookups
uint numTemplateInstanceLookups;
Undocumented in source.
numTemplateInstantiations
uint numTemplateInstantiations;
Undocumented in source.
objSymTab
ObjectSymbolTable objSymTab;

Symbols, sections and references

outputFilename
string outputFilename;
printAstFresh
bool printAstFresh;

Print AST right after parsing

printAstSema
bool printAstSema;

Print AST after semantic analysis

printCodeHex
bool printCodeHex;
Undocumented in source.
printIr
bool printIr;

Print IR after AST to IR pass

printIrLower
bool printIrLower;

Print IR after all IR lowering passes Will not activate if printIrLowerEach is true

printIrLowerEach
bool printIrLowerEach;

Print IR after each IR lowering pass

printIrOpt
bool printIrOpt;

Print IR after all optimization passes Will not activate if printIrOptEach is true

printIrOptEach
bool printIrOptEach;

Print IR after each optimization pass

printLexemes
bool printLexemes;

Print lexemes after lexing

printLir
bool printLir;

Print LIR after IR to LIR pass

printLirRA
bool printLirRA;

Print LIR after Register Allocation

printLiveIntervals
bool printLiveIntervals;

Print liveness analisys info

printOnlyFun
Identifier printOnlyFun;
Undocumented in source.
printSource
bool printSource;

Print source before lexing

printStackLayout
bool printStackLayout;
Undocumented in source.
printStaticData
bool printStaticData;
Undocumented in source.
printSymbols
bool printSymbols;
Undocumented in source.
printTimings
bool printTimings;
Undocumented in source.
printTodos
bool printTodos;
Undocumented in source.
printTraceOnError
bool printTraceOnError;

If true, stack traces are added to output

roStaticDataBuffer
Arena!ubyte roStaticDataBuffer;

Buffer for string/array/struct literals String literals have \0 after last character Must be allocated before or after code segment to allow relative addressing Static read-only data

runTesters
bool runTesters;
Undocumented in source.
sectionAlignemnt
uint sectionAlignemnt;
sink
TextSink sink;

Text output for errors and stack traces

sourceBuffer
Arena!char sourceBuffer;

Buffer for sources of all modules

staticDataBuffer
Arena!ubyte staticDataBuffer;

Static read-write data. zero-initialized data is stored after initialized data

targetOs
TargetOs targetOs;

Target OS

tempBuf
TextSink tempBuf;
Undocumented in source.
tempBuffer
Arena!uint tempBuffer;

Buffer for intra-pass temporary data

tokenBuffer
Arena!TokenType tokenBuffer;

Token buffer

tokenLocationBuffer
Arena!SourceLocation tokenLocationBuffer;

Token locations in source code

types
IrTypeStorage types;

Type storage

useFramePointer
bool useFramePointer;
v128Type
IrIndex v128Type;
Undocumented in source.
validateIr
bool validateIr;

If true, every pass that generates/changes IR, performs validation

verboseErrors
bool verboseErrors;

More details in errors

vmBuffer
Arena!ubyte vmBuffer;

Buffer for frame data of IR interpreter

windowsSubsystem
WindowsSubsystem windowsSubsystem;

Build executable

zeroDataLength
uint zeroDataLength;
Undocumented in source.

Meta