diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-04 22:07:37 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-04 22:10:28 -0700 |
commit | ab73a9c1a77cc9502f07ff8a9d1fd9dadccd702f (patch) | |
tree | 0a2c60d2b55104646b3e528583243467bda98729 /lldb/include | |
parent | 3145e60caf5b7e2b5276998654275cb2cacd4825 (diff) | |
download | llvm-ab73a9c1a77cc9502f07ff8a9d1fd9dadccd702f.tar.gz |
[lldb] Eliminate {Get,Set}PropertyAtIndexAsFileSpec (NFC)
This patch is a continuation of 6f8b33f6dfd0 and eliminates the
{Get,Set}PropertyAtIndexAsFileSpec functions.
Diffstat (limited to 'lldb/include')
-rw-r--r-- | lldb/include/lldb/Interpreter/OptionValue.h | 9 | ||||
-rw-r--r-- | lldb/include/lldb/Interpreter/OptionValueProperties.h | 7 |
2 files changed, 7 insertions, 9 deletions
diff --git a/lldb/include/lldb/Interpreter/OptionValue.h b/lldb/include/lldb/Interpreter/OptionValue.h index eef7d67eb034..41dc6c440593 100644 --- a/lldb/include/lldb/Interpreter/OptionValue.h +++ b/lldb/include/lldb/Interpreter/OptionValue.h @@ -13,6 +13,7 @@ #include "lldb/Utility/Cloneable.h" #include "lldb/Utility/CompletionRequest.h" #include "lldb/Utility/ConstString.h" +#include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Status.h" #include "lldb/lldb-defines.h" #include "lldb/lldb-private-enumerations.h" @@ -269,9 +270,9 @@ public: bool SetEnumerationValue(int64_t value); - FileSpec GetFileSpecValue() const; + std::optional<FileSpec> GetFileSpecValue() const; - bool SetFileSpecValue(const FileSpec &file_spec); + bool SetFileSpecValue(FileSpec file_spec); FileSpecList GetFileSpecListValue() const; @@ -334,6 +335,8 @@ public: return GetCharValue(); if constexpr (std::is_same_v<T, lldb::Format>) return GetFormatValue(); + if constexpr (std::is_same_v<T, FileSpec>) + return GetFileSpecValue(); if constexpr (std::is_same_v<T, lldb::LanguageType>) return GetLanguageValue(); if constexpr (std::is_same_v<T, llvm::StringRef>) @@ -362,6 +365,8 @@ public: bool SetValueAs(lldb::LanguageType v) { return SetLanguageValue(v); } + bool SetValueAs(FileSpec v) { return SetFileSpecValue(v); } + template <typename T, std::enable_if_t<std::is_enum_v<T>, bool> = true> bool SetValueAs(T t) { return SetEnumerationValue(t); diff --git a/lldb/include/lldb/Interpreter/OptionValueProperties.h b/lldb/include/lldb/Interpreter/OptionValueProperties.h index 617fedc7d13e..004ed55e3b11 100644 --- a/lldb/include/lldb/Interpreter/OptionValueProperties.h +++ b/lldb/include/lldb/Interpreter/OptionValueProperties.h @@ -134,13 +134,6 @@ public: OptionValueFileSpec *GetPropertyAtIndexAsOptionValueFileSpec( uint32_t idx, const ExecutionContext *exe_ctx = nullptr) const; - FileSpec - GetPropertyAtIndexAsFileSpec(uint32_t idx, - const ExecutionContext *exe_ctx = nullptr) const; - - bool SetPropertyAtIndexAsFileSpec(uint32_t idx, const FileSpec &file_spec, - const ExecutionContext *exe_ctx = nullptr); - OptionValuePathMappings *GetPropertyAtIndexAsOptionValuePathMappings( uint32_t idx, const ExecutionContext *exe_ctx = nullptr) const; |