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 optimize = 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
 

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_include_paths

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

additional C++ directories to search for #include files.

◆ 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)

◆ library_paths

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

additional directories to search for imported files

◆ optimize

bool hilti::Options::optimize = false

generated optimized code

◆ skip_validation

bool hilti::Options::skip_validation = false

if true, skip AST validation; for debugging only, things will may downhiull 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: