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 #include <utility>
7 
8 #include <hilti/compiler/driver.h>
9 
10 namespace spicy {
11 
15 struct Options {
16  bool track_offsets = false;
17 };
18 
28 class Driver : public hilti::Driver {
29 public:
34  explicit Driver(std::string name) : hilti::Driver(std::move(name)) {}
35 
43  Driver(std::string name, const hilti::rt::filesystem::path& argv0) : hilti::Driver(std::move(name), argv0) {}
44 
45  ~Driver() override {}
46 
47  Driver() = delete;
48  Driver(const Driver&) = delete;
49  Driver(Driver&&) noexcept = delete;
50  Driver& operator=(const Driver&) = delete;
51  Driver& operator=(Driver&&) noexcept = delete;
52 
54  spicy::Options spicyCompilerOptions() const;
55 
61  void setSpicyCompilerOptions(const spicy::Options& options);
62 
63 protected:
64  std::string hookAddCommandLineOptions() override;
65  bool hookProcessCommandLineOption(int opt, const char* optarg) override;
66  std::string hookAugmentUsage() override;
67 
68 private:
69  spicy::Options _compiler_options;
70 };
71 
72 } // namespace spicy
Definition: driver.h:15
Definition: optional.h:79
Driver(std::string name)
Definition: driver.h:34
Driver(std::string name, const hilti::rt::filesystem::path &argv0)
Definition: driver.h:43
Definition: driver.h:28
Definition: driver.h:83
bool track_offsets
Definition: driver.h:16