![]() |
Spicy
|
#include <driver.h>
Public Member Functions | |
Driver (std::string name) | |
Driver (std::string name, const hilti::rt::filesystem::path &argv0) | |
Driver (const Driver &)=delete | |
Driver (Driver &&) noexcept=delete | |
Driver & | operator= (const Driver &)=delete |
Driver & | operator= (Driver &&) noexcept=delete |
spicy::Options | spicyCompilerOptions () const |
void | setSpicyCompilerOptions (const spicy::Options &options) |
![]() | |
Driver (std::string name) | |
Driver (std::string name, const hilti::rt::filesystem::path &argv0) | |
Driver (const Driver &)=delete | |
Driver (Driver &&) noexcept=delete | |
Driver & | operator= (const Driver &)=delete |
Driver & | operator= (Driver &&) noexcept=delete |
Result< Nothing > | parseOptions (int argc, char **argv) |
Result< Nothing > | addInput (const std::shared_ptr< Unit > &u) |
Result< Nothing > | addInput (const hilti::rt::filesystem::path &path) |
bool | hasInputs () const |
const auto & | driverOptions () const |
const auto & | hiltiOptions () const |
void | setDriverOptions (driver::Options options) |
void | setCompilerOptions (hilti::Options options) |
Result< Nothing > | initialize () |
Result< Nothing > | compile () |
const auto & | context () const |
const auto & | options () const |
Result< Nothing > | initRuntime () |
Result< Nothing > | executeMain () |
Result< Nothing > | finishRuntime () |
Result< Nothing > | run () |
Protected Member Functions | |
std::string | hookAddCommandLineOptions () override |
bool | hookProcessCommandLineOption (int opt, const char *optarg) override |
std::string | hookAugmentUsage () override |
![]() | |
void | usage () |
Result< Nothing > | compileUnits () |
Result< Nothing > | codegenUnits () |
Result< Nothing > | linkUnits () |
Result< Nothing > | outputUnits () |
Result< Nothing > | jitUnits () |
result::Error | error (std::string_view msg, const hilti::rt::filesystem::path &p="") |
result::Error | augmentError (const result::Error &err, const hilti::rt::filesystem::path &p="") |
Result< std::ofstream > | openOutput (const hilti::rt::filesystem::path &p, bool binary=false, bool append=false) |
Result< Nothing > | openInput (std::ifstream &in, const hilti::rt::filesystem::path &p) |
Result< Nothing > | writeOutput (std::ifstream &in, const hilti::rt::filesystem::path &p) |
Result< std::stringstream > | readInput (const hilti::rt::filesystem::path &p) |
Result< hilti::rt::filesystem::path > | writeToTemp (std::ifstream &in, const std::string &name_hint, const std::string &extension="tmp") |
void | dumpUnit (const Unit &unit) |
void | printHiltiException (const hilti::rt::Exception &e) |
virtual void | hookAddInput (std::shared_ptr< Unit > unit) |
virtual void | hookAddInput (const hilti::rt::filesystem::path &path) |
virtual void | hookNewASTPreCompilation (std::shared_ptr< Unit > unit) |
virtual void | hookNewASTPostCompilation (std::shared_ptr< Unit > unit) |
virtual Result< Nothing > | hookCompilationFinished (const Plugin &plugin) |
virtual void | hookInitRuntime () |
virtual void | hookFinishRuntime () |
Compiler driver.
The driver is a high-level building block for writing command-line tools compiling Spicy source files (and more). spicyc
is just a tiny wrapper around this class. This class derives from hilti::Driver
`, which does all the heavy lifting. Classes can in turn further derive from the driver to expand its functionality.
|
inlineexplicit |
name | descriptive name for the tool using the driver, which will be used in usage and error messages. |
|
inline |
name | descriptive name for the tool using the driver, which will be used in usage and error messages. |
argv0 | the current executable, which will change the path's that the global options instance returns if it's inside Spicy build directory. |
|
overrideprotectedvirtual |
Hook for derived classes to add more options to the getopt() option string.
Reimplemented from hilti::Driver.
|
overrideprotectedvirtual |
Hook for derived classes for adding content to the driver's usage message (--help
).
Reimplemented from hilti::Driver.
|
overrideprotectedvirtual |
Hook for derived classes for parsing additional options.
Reimplemented from hilti::Driver.
void Driver::setSpicyCompilerOptions | ( | const spicy::Options & | options | ) |
Sets Spicy's compiler options.
options | the options |
spicy::Options Driver::spicyCompilerOptions | ( | ) | const |
Returns the Spicy compiler options currently in effect.