]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionGroupArchitecture.h
MFV r302260: expat 2.2.0
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Interpreter / OptionGroupArchitecture.h
1 //===-- OptionGroupArchitecture.h -------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_OptionGroupArchitecture_h_
11 #define liblldb_OptionGroupArchitecture_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Interpreter/Options.h"
18 #include "lldb/Core/ArchSpec.h"
19
20 namespace lldb_private {
21
22 //-------------------------------------------------------------------------
23 // OptionGroupArchitecture
24 //-------------------------------------------------------------------------
25
26 class OptionGroupArchitecture : public OptionGroup
27 {
28 public:
29     OptionGroupArchitecture ();
30     
31     ~OptionGroupArchitecture() override;
32
33     uint32_t
34     GetNumDefinitions() override;
35     
36     const OptionDefinition*
37     GetDefinitions() override;
38     
39     Error
40     SetOptionValue(CommandInterpreter &interpreter,
41                    uint32_t option_idx,
42                    const char *option_value) override;
43     
44     void
45     OptionParsingStarting(CommandInterpreter &interpreter) override;
46     
47     bool
48     GetArchitecture (Platform *platform, ArchSpec &arch);
49
50     bool
51     ArchitectureWasSpecified () const
52     {
53         return !m_arch_str.empty();
54     }
55
56     const char *
57     GetArchitectureName()
58     {
59         return (m_arch_str.empty() ? nullptr : m_arch_str.c_str());
60     }
61
62 protected:
63     std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture
64 };
65
66 } // namespace lldb_private
67
68 #endif // liblldb_OptionGroupArchitecture_h_