Spicy
driver.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <string>
6 
7 #include <hilti/compiler/driver.h>
8 
9 namespace spicy {
10 
14 struct Options {
15  bool track_offsets = false;
16 };
17 
27 class Driver : public hilti::Driver {
28 public:
33  explicit Driver(std::string name) : hilti::Driver(name) {}
34 
42  Driver(std::string name, const hilti::rt::filesystem::path& argv0) : hilti::Driver(name, argv0) {}
43 
44  virtual ~Driver() {}
45 
46  Driver() = delete;
47  Driver(const Driver&) = delete;
48  Driver(Driver&&) noexcept = delete;
49  Driver& operator=(const Driver&) = delete;
50  Driver& operator=(Driver&&) noexcept = delete;
51 
53  spicy::Options spicyCompilerOptions() const;
54 
60  void setSpicyCompilerOptions(const spicy::Options& options);
61 
62 protected:
63  std::string hookAddCommandLineOptions() override;
64  bool hookProcessCommandLineOption(int opt, const char* optarg) override;
65  std::string hookAugmentUsage() override;
66 
67 private:
68  spicy::Options _compiler_options;
69 };
70 
71 } // namespace spicy
Definition: driver.h:14
Driver(std::string name)
Definition: driver.h:33
Driver(std::string name, const hilti::rt::filesystem::path &argv0)
Definition: driver.h:42
Definition: driver.h:27
Definition: driver.h:83
bool track_offsets
Definition: driver.h:15