MimIR 0.1
MimIR is my Intermediate Representation
|
Some "global" variables needed all over the place. More...
#include <mim/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 MimIR 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) |
Some "global" variables needed all over the place.
Well, there are not really global - that's the point of this class.
mim::Driver::Driver | ( | ) |
Definition at line 19 of file driver.cpp.
References add_search_path(), MIM_INSTALL_PREFIX, mim::sys::path_to_curr_exe(), and search_paths().
const fs::path * mim::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.
|
inline |
|
inline |
|
inline |
Definition at line 23 of file driver.h.
Referenced by mim::World::flags(), mim::ast::load_plugins(), main(), normalizer(), and pass().
|
inline |
Definition at line 65 of file driver.h.
References get_fun_ptr().
void * mim::Driver::get_fun_ptr | ( | Sym | plugin, |
const char * | name ) |
Definition at line 91 of file driver.cpp.
References mim::dl::get(), and mim::lookup().
Referenced by get_fun_ptr(), and get_fun_ptr().
|
inline |
Definition at line 62 of file driver.h.
References get_fun_ptr().
|
inline |
|
inline |
|
inline |
void mim::Driver::load | ( | Sym | name | ) |
Definition at line 53 of file driver.cpp.
References mim::assert_emplace(), mim::dl::close(), mim::error(), mim::dl::get(), ILOG, is_loaded(), mim::mim_get_plugin(), mim::dl::open(), search_paths(), and WLOG.
Referenced by mim::ast::load_plugins(), and mim::ast::Parser::plugin().
|
inline |
Definition at line 24 of file driver.h.
Referenced by mim::World::log(), and main().
|
inline |
Definition at line 74 of file driver.h.
References flags(), and mim::lookup().
|
inline |
Definition at line 73 of file driver.h.
References flags(), and mim::lookup().
Referenced by mim::optimize().
|
inline |