![]() |
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) |
Public Member Functions inherited from hilti::Driver | |
| 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) |
| void | registerUnit (const std::shared_ptr< Unit > &unit) |
| Unit * | lookupUnit (const declaration::module::UID &uid) const |
| void | updateProcessExtension (const declaration::module::UID &uid, const hilti::rt::filesystem::path &ext) |
| Result< Nothing > | addInput (const hilti::rt::filesystem::path &path) |
| Result< Nothing > | addInput (declaration::module::UID uid) |
| 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 |
| auto * | builder () const |
| const auto & | options () const |
| Result< Nothing > | initRuntime () |
| Result< Nothing > | executeMain () |
| Result< Nothing > | finishRuntime () |
| void | fatalError (const std::string &msg) |
| void | fatalError (const hilti::result::Error &error) |
| Result< Nothing > | run () |
Protected Member Functions | |
| std::unique_ptr< hilti::Builder > | createBuilder (hilti::ASTContext *ctx) const override |
| std::string | hookAddCommandLineOptions () override |
| bool | hookProcessCommandLineOption (int opt, const char *optarg) override |
| std::string | hookAugmentUsage () override |
Protected Member Functions inherited from hilti::Driver | |
| 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 (const Plugin &plugin, ASTRoot *root) |
| virtual bool | hookNewASTPostCompilation (const Plugin &plugin, ASTRoot *root) |
| virtual Result< Nothing > | hookCompilationFinished (ASTRoot *root) |
| 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 |
Instantiates a new builder tied to a given context. Derived class can override this to create a builder own their own type (as long as that's derived from hilti::Builder).
| ctx | context to create builder for |
Reimplemented from hilti::Driver.
|
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.