Spicy
Public Member Functions | Public Attributes | List of all members
hilti::Options Struct Reference

#include <context.h>

Public Member Functions

template<typename T >
getAuxOption (const std::string &key, T default_) const
 
template<typename T >
void setAuxOption (const std::string &key, T value)
 
Result< NothingparseDebugAddl (const std::string &flags)
 
void print (std::ostream &out) const
 

Public Attributes

bool debug = false
 
bool debug_trace
 
bool debug_flow = false
 
bool track_location = true
 
bool skip_validation = false
 
bool enable_profiling = false
 
std::vector< hilti::rt::filesystem::path > library_paths
 
std::string cxx_namespace_extern
 
std::string cxx_namespace_intern = "__hlt"
 
std::vector< hilti::rt::filesystem::path > cxx_include_paths
 
bool keep_tmps = false
 
std::vector< std::string > cxx_link
 
bool cxx_enable_dynamic_globals
 
bool global_optimizations = true
 
bool import_standard_modules = true
 

Detailed Description

Options controlling the compiler's code generation.

In addition to HILTI's built-in options, external components can store further options through auxiliary value/key mappings.

Member Function Documentation

◆ getAuxOption()

template<typename T >
T hilti::Options::getAuxOption ( const std::string &  key,
default_ 
) const
inline

Retrieves the value for an auxiliary option.

Parameters
keyunique key, which should use a namespaced x.y structure.
defaultvalue to return if key has not been explicitly set
Template Parameters
typeof the key's value, which must match the type used when the option is being set
Returns
either the recorded value for key, or default none

◆ parseDebugAddl()

Result< Nothing > Options::parseDebugAddl ( const std::string &  flags)

Parses a comma-separated list of tokens indicating which additional debug instrumentation to activate, and sets the instance's corresponding options.

Returns
An error if a flag isn't known.

◆ print()

void Options::print ( std::ostream &  out) const

Prints out a humand-readable version of the current options.

◆ setAuxOption()

template<typename T >
void hilti::Options::setAuxOption ( const std::string &  key,
value 
)
inline

Sets the value for an auxiliary option.

Parameters
keyunique key, which should use a namespaced x.y structure.
valuevalue to record for the option
Template Parameters
typeof the key's value, which must match the type used when the option is being retrieved

Member Data Documentation

◆ cxx_enable_dynamic_globals

bool hilti::Options::cxx_enable_dynamic_globals
Initial value:
=
false

if true, allocate globals dynamically at runtime for (future) thread safety

◆ cxx_include_paths

std::vector<hilti::rt::filesystem::path> hilti::Options::cxx_include_paths

additional C++ directories to search for #include files

◆ cxx_link

std::vector<std::string> hilti::Options::cxx_link

additional static archives or shared libraries to link during JIT

◆ cxx_namespace_extern

std::string hilti::Options::cxx_namespace_extern
Initial value:
=
"hlt"

CXX namespace for generated C++ code accessible to the host application

◆ cxx_namespace_intern

std::string hilti::Options::cxx_namespace_intern = "__hlt"

CXX namespace for generated internal C++ code

◆ debug

bool hilti::Options::debug = false

if true, generate non-optimized debug code

◆ debug_flow

bool hilti::Options::debug_flow = false

if true, generate code to log function calls and returns to debug stream "hilti-flow" (requires debug, too)

◆ debug_trace

bool hilti::Options::debug_trace
Initial value:
=
false

if true, generate code to log statements to debug stream "hilti-trace" (requires debug, too)

◆ enable_profiling

bool hilti::Options::enable_profiling = false

if true, generate code to profile execution times of individual code sections

◆ global_optimizations

bool hilti::Options::global_optimizations = true

whether to run global HILTI optimizations on the generated code.

◆ import_standard_modules

bool hilti::Options::import_standard_modules = true

automatically import standard modules into the global namespace. this is required, turn off only for debugging.

◆ keep_tmps

bool hilti::Options::keep_tmps = false

if true, do not remove generated files on exit

◆ library_paths

std::vector<hilti::rt::filesystem::path> hilti::Options::library_paths

additional directories to search for imported files

◆ skip_validation

bool hilti::Options::skip_validation = false

if true, skip AST validation; for debugging only, things may go downhill quickly if an AST is not well-formed

◆ track_location

bool hilti::Options::track_location = true

if true, generate code to record current source code location during execution


The documentation for this struct was generated from the following files: