#include <context.h>
Context storing compiler-wide state
◆ Context()
Context::Context |
( |
Options |
options | ) |
|
|
explicit |
- Parameters
-
options | options to use for code compilation |
◆ ~Context()
◆ lookupDependenciesForModule()
std::vector< CachedModule > Context::lookupDependenciesForModule |
( |
const ID & |
id | ) |
|
Returns all (direct) dependencies that a module imports. This information may be correct yet, if final
isn't set in the module meta data.
- Parameters
-
meta | data for all dependencies |
◆ lookupModule() [1/2]
Looks up a previously cached module AST.
- Parameters
-
id | ID that was used to cache the AST |
- Returns
- the meta data associated with the previously cached module, or not set if no module is associated with that ID
◆ lookupModule() [2/2]
std::optional< CachedModule > Context::lookupModule |
( |
const hilti::rt::filesystem::path & |
path | ) |
|
Looks up a previously cached module AST.
- Parameters
-
path | path that was used to cache the AST |
- Returns
- the meta data associated with the previously cached module, or not set if no module is associated with that path
◆ options()
const Options& hilti::Context::options |
( |
| ) |
const |
|
inline |
Returns the context's compiler options.
◆ registerModule()
Makes a new module known to the context, which will take ownershiup and cache it, along with further meta data. A module with the same ID or path must only be registered once, the method will abort otherwise.
- Parameters
-
idx | cache index for module |
module | module to cache |
requires_compilation | initial value for the corresponding CachedModule field; this may later be overridden if AST processing finds out more |
- Returns
- the meta data associated with the newly registered module
◆ updateModule()
Updates the meta data associated with a previoysly cached module AST.
- Parameters
-
module | module to cache; all the fields of the struct must have been filled out |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/spicy-docs/checkouts/v1.2.1/hilti/toolchain/include/compiler/context.h
- /home/docs/checkouts/readthedocs.org/user_builds/spicy-docs/checkouts/v1.2.1/hilti/toolchain/src/compiler/context.cc