[MLIR][TOSA] Update CustomOp input and output names (#118408)
[llvm-project.git] / lldb / tools / driver / Driver.h
blob83e0d8a41cfdb1e88308d7107f1159d199296639
1 //===-- Driver.h ------------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_TOOLS_DRIVER_DRIVER_H
10 #define LLDB_TOOLS_DRIVER_DRIVER_H
12 #include "Platform.h"
14 #include "lldb/API/SBBroadcaster.h"
15 #include "lldb/API/SBDebugger.h"
16 #include "lldb/API/SBDefines.h"
17 #include "lldb/API/SBError.h"
19 #include "llvm/Option/Arg.h"
20 #include "llvm/Option/ArgList.h"
21 #include "llvm/Option/Option.h"
23 #include <set>
24 #include <string>
25 #include <vector>
27 class Driver : public lldb::SBBroadcaster {
28 public:
29 enum CommandPlacement {
30 eCommandPlacementBeforeFile,
31 eCommandPlacementAfterFile,
32 eCommandPlacementAfterCrash,
35 Driver();
37 virtual ~Driver();
39 /// Runs the main loop.
40 ///
41 /// \return The exit code that the process should return.
42 int MainLoop();
44 lldb::SBError ProcessArgs(const llvm::opt::InputArgList &args, bool &exiting);
46 void WriteCommandsForSourcing(CommandPlacement placement,
47 lldb::SBStream &strm);
49 struct OptionData {
50 void AddInitialCommand(std::string command, CommandPlacement placement,
51 bool is_file, lldb::SBError &error);
53 struct InitialCmdEntry {
54 InitialCmdEntry(std::string contents, bool in_is_file,
55 bool in_quiet = false)
56 : contents(std::move(contents)), is_file(in_is_file),
57 source_quietly(in_quiet) {}
59 std::string contents;
60 bool is_file;
61 bool source_quietly;
64 std::vector<std::string> m_args;
66 lldb::LanguageType m_repl_lang = lldb::eLanguageTypeUnknown;
67 lldb::pid_t m_process_pid = LLDB_INVALID_PROCESS_ID;
69 std::string m_core_file;
70 std::string m_crash_log;
71 std::string m_repl_options;
72 std::string m_process_name;
74 std::vector<InitialCmdEntry> m_initial_commands;
75 std::vector<InitialCmdEntry> m_after_file_commands;
76 std::vector<InitialCmdEntry> m_after_crash_commands;
78 bool m_source_quietly = false;
79 bool m_print_version = false;
80 bool m_print_python_path = false;
81 bool m_print_script_interpreter_info = false;
82 bool m_wait_for = false;
83 bool m_repl = false;
84 bool m_batch = false;
86 // FIXME: When we have set/show variables we can remove this from here.
87 bool m_use_external_editor = false;
89 using OptionSet = std::set<char>;
90 OptionSet m_seen_options;
93 lldb::SBDebugger &GetDebugger() { return m_debugger; }
95 void ResizeWindow(unsigned short col);
97 private:
98 lldb::SBDebugger m_debugger;
99 OptionData m_option_data;
102 #endif // LLDB_TOOLS_DRIVER_DRIVER_H