Thorin 1.9.0
The Higher ORder INtermediate representation
|
Some "global" variables needed all over the place. More...
#include <thorin/driver.h>
Public Member Functions | |
Driver () | |
Getters | |
Flags & | flags () |
Log & | log () |
World & | world () |
Manage Search Paths | |
Search paths for plugins are in the following order:
| |
const auto & | search_paths () const |
void | add_search_path (fs::path path) |
Manage Imports | |
This is a list of pairs where each pair contains:
| |
const auto & | imports () |
const fs::path * | add_import (fs::path, Sym) |
Yields a fs::path* if not already added that you can use in Location; returns nullptr otherwise. | |
Load Plugin | |
Finds and loads a shared object file that implements the Thorin Plugin If name is an absolute path to a | |
void | load (Sym name) |
void | load (const std::string &name) |
bool | is_loaded (Sym sym) const |
void * | get_fun_ptr (Sym plugin, const char *name) |
template<class F > | |
auto | get_fun_ptr (Sym plugin, const char *name) |
template<class F > | |
auto | get_fun_ptr (const char *plugin, const char *name) |
Manage Plugins | |
All these lookups yield | |
auto | pass (flags_t flags) |
auto | normalizer (flags_t flags) const |
auto | normalizer (plugin_t d, tag_t t, sub_t s) const |
auto | backend (std::string_view name) |
Manage Annex | |
const auto & | plugin2annxes (Sym plugin) |
std::pair< Annex &, bool > | name2annex (Sym sym, Sym plugin, Sym tag, Loc loc) |
Some "global" variables needed all over the place.
Well, there are not really global - that's the point of this class.
thorin::Driver::Driver | ( | ) |
Definition at line 19 of file driver.cpp.
References add_search_path(), thorin::sys::path_to_curr_exe(), search_paths(), and THORIN_INSTALL_PREFIX.
const fs::path * thorin::Driver::add_import | ( | fs::path | path, |
Sym | sym | ||
) |
Yields a fs::path*
if not already added that you can use in Location; returns nullptr
otherwise.
Definition at line 45 of file driver.cpp.
Referenced by thorin::Parser::import().
|
inline |
|
inline |
Definition at line 76 of file driver.h.
References thorin::lookup().
|
inline |
Definition at line 23 of file driver.h.
Referenced by thorin::World::flags(), main(), normalizer(), and pass().
|
inline |
void * thorin::Driver::get_fun_ptr | ( | Sym | plugin, |
const char * | name | ||
) |
Definition at line 91 of file driver.cpp.
References thorin::dl::get(), and thorin::lookup().
Referenced by get_fun_ptr().
|
inline |
Definition at line 62 of file driver.h.
References get_fun_ptr().
|
inline |
Definition at line 47 of file driver.h.
Referenced by thorin::World::dump().
|
inline |
Definition at line 60 of file driver.h.
References thorin::lookup().
Referenced by thorin::World::dump(), and load().
|
inline |
void thorin::Driver::load | ( | Sym | name | ) |
Definition at line 53 of file driver.cpp.
References thorin::assert_emplace(), thorin::dl::close(), thorin::error(), thorin::dl::get(), ILOG, is_loaded(), thorin::dl::open(), search_paths(), thorin::thorin_get_plugin(), and WLOG.
Referenced by thorin::Parser::plugin().
|
inline |
Definition at line 24 of file driver.h.
Referenced by thorin::World::log().
std::pair< Annex &, bool > thorin::Driver::name2annex | ( | Sym | sym, |
Sym | plugin, | ||
Sym | tag, | ||
Loc | loc | ||
) |
Definition at line 96 of file driver.cpp.
References thorin::error().
|
inline |
Definition at line 74 of file driver.h.
References flags(), and thorin::lookup().
|
inline |
Definition at line 73 of file driver.h.
References flags(), and thorin::lookup().
Referenced by thorin::optimize().
|
inline |
Definition at line 81 of file driver.h.
Referenced by thorin::bootstrap().
|
inline |
Definition at line 36 of file driver.h.
Referenced by Driver(), thorin::Parser::import(), and load().