OptionGroupArchitecture.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //===-- OptionGroupArchitecture.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. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_INTERPRETER_OPTIONGROUPARCHITECTURE_H
  9. #define LLDB_INTERPRETER_OPTIONGROUPARCHITECTURE_H
  10. #include "lldb/Interpreter/Options.h"
  11. #include "lldb/Utility/ArchSpec.h"
  12. namespace lldb_private {
  13. // OptionGroupArchitecture
  14. class OptionGroupArchitecture : public OptionGroup {
  15. public:
  16. OptionGroupArchitecture() = default;
  17. ~OptionGroupArchitecture() override = default;
  18. llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
  19. Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
  20. ExecutionContext *execution_context) override;
  21. void OptionParsingStarting(ExecutionContext *execution_context) override;
  22. bool GetArchitecture(Platform *platform, ArchSpec &arch);
  23. bool ArchitectureWasSpecified() const { return !m_arch_str.empty(); }
  24. llvm::StringRef GetArchitectureName() const { return m_arch_str; }
  25. protected:
  26. std::string m_arch_str; // Save the arch triple in case a platform is
  27. // specified after the architecture
  28. };
  29. } // namespace lldb_private
  30. #endif // LLDB_INTERPRETER_OPTIONGROUPARCHITECTURE_H