Some "global" variables needed all over the place. More...
#include <mim/driver.h>
Classes | |
| class | Imports |
Public Member Functions | |
Construction | |
| Driver (std::string name) | |
| Driver () | |
| Driver (const Driver &)=delete | |
| Driver (Driver &&)=delete | |
| Driver & | operator= (Driver)=delete |
Getters | |
| Flags & | flags () |
| const Flags & | flags () const |
| Log & | log () const |
| Profiler & | profiler () |
| const Profiler & | profiler () const |
| World & | world () |
| const Version & | version () const |
| MimIR Version. | |
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 tracks:
| |
| const Imports & | imports () const |
| Imports & | imports () |
Load Plugin | |
Finds and loads a shared object file that implements the MimIR Plugin If name is an absolute path to a .so/.dll file, this is used. Otherwise, "name", "libmim_name.so" (Linux, Mac), "mim_name.dll" (Win) are searched for in Driver::search_paths(). | |
| 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 nullptr if the key has not been found. | |
| auto | phase (flags_t flags) |
| const auto & | phases () const |
| auto | normalizer (flags_t flags) const |
| auto | normalizer (plugin_t d, tag_t t, sub_t s) const |
Plugin/Phase Arguments | |
Freeform command-line arguments addressed to a plugin/phase (-X <plugin>:<arg>). A Phase reads its own arguments via Phase::args(). | |
| void | add_arg (Sym plugin, std::string arg) |
| const Vector< std::string > & | args (Sym plugin) const |
Yields an empty Vector if plugin has none. | |
Some "global" variables needed all over the place.
Well, there are not really global - that's the point of this class.
| mim::Driver::Driver | ( | std::string | name | ) |
Definition at line 47 of file driver.cpp.
References add_search_path(), MIM_INSTALL_PREFIX, MIM_LIBDIR, MIM_VERSION, mim::sys::path_to_libmim(), and search_paths().
Referenced by Driver(), Driver(), Driver(), mim::Driver::Imports::Imports(), and operator=().
|
delete |
References Driver().
|
delete |
References Driver().
|
inline |
|
inline |
| const Vector< std::string > & mim::Driver::args | ( | Sym | plugin | ) | const |
Yields an empty Vector if plugin has none.
Definition at line 127 of file driver.cpp.
Referenced by mim::Phase::args().
|
inline |
Definition at line 35 of file driver.h.
Referenced by mim::World::flags(), load(), mim::ast::load_plugins(), main(), normalizer(), phase(), mim::Phase::run(), mim::PhaseMan::start(), and mim::RWPhase::start().
|
inline |
Definition at line 115 of file driver.h.
References get_fun_ptr().
|
inline |
Definition at line 110 of file driver.h.
References get_fun_ptr().
| void * mim::Driver::get_fun_ptr | ( | Sym | plugin, |
| const char * | name ) |
Definition at line 122 of file driver.cpp.
References mim::dl::get(), and mim::lookup().
Referenced by get_fun_ptr(), and get_fun_ptr().
|
inline |
|
inline |
| void mim::Driver::load | ( | Sym | name | ) |
Definition at line 76 of file driver.cpp.
References mim::assert_emplace(), mim::dl::close(), mim::dl::extension, flags(), mim::dl::get(), ILOG, is_loaded(), mim::mim_get_plugin(), mim::dl::open(), search_paths(), version(), and WLOG.
Referenced by mim::ast::Parser::import().
|
inline |
Definition at line 37 of file driver.h.
Referenced by mim::World::log(), and main().
|
inline |
Definition at line 125 of file driver.h.
References flags(), and mim::lookup().
Definition at line 126 of file driver.h.
References mim::Annex::flags(), and normalizer().
Referenced by normalizer().
|
inline |
Definition at line 123 of file driver.h.
References flags(), and mim::lookup().
Referenced by mim::optimize(), mim::Phase::recreate(), and mim::plug::gpu::phase::run_stage().
|
inline |
Definition at line 38 of file driver.h.
Referenced by main(), mim::Phase::profile_count(), and mim::Phase::run().
|
inline |
|
inline |