summaryrefslogtreecommitdiff
path: root/lldb/include
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2023-05-14 19:58:16 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2023-05-14 20:18:47 -0700
commit3ebb33632a1509450fdbc1fb6a21107a0a513072 (patch)
treeb71ac7a9114332ab18e5e5f9f0d78dbcef5fc4a4 /lldb/include
parent245549c57517de3b8fa478512bb1ae4295215e31 (diff)
downloadllvm-3ebb33632a1509450fdbc1fb6a21107a0a513072.tar.gz
[lldb] Complete OptionValue cleanup (NFC)
Make the `Get.*Value` and `Set.*Value` function private and migrate the last remaining call sites to the new overloaded/templated functions.
Diffstat (limited to 'lldb/include')
-rw-r--r--lldb/include/lldb/Core/Debugger.h4
-rw-r--r--lldb/include/lldb/Interpreter/OptionValue.h100
2 files changed, 52 insertions, 52 deletions
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index f05d8d4e6b23..54f7d5c0edb4 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -285,7 +285,7 @@ public:
uint64_t GetTerminalWidth() const;
- bool SetTerminalWidth(uint32_t term_width);
+ bool SetTerminalWidth(uint64_t term_width);
llvm::StringRef GetPrompt() const;
@@ -351,7 +351,7 @@ public:
uint64_t GetTabSize() const;
- bool SetTabSize(uint32_t tab_size);
+ bool SetTabSize(uint64_t tab_size);
lldb::DWIMPrintVerbosity GetDWIMPrintVerbosity() const;
diff --git a/lldb/include/lldb/Interpreter/OptionValue.h b/lldb/include/lldb/Interpreter/OptionValue.h
index 730ec65dd054..9e65c802b370 100644
--- a/lldb/include/lldb/Interpreter/OptionValue.h
+++ b/lldb/include/lldb/Interpreter/OptionValue.h
@@ -17,6 +17,8 @@
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/FileSpecList.h"
#include "lldb/Utility/Status.h"
+#include "lldb/Utility/StringList.h"
+#include "lldb/Utility/UUID.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-private-enumerations.h"
#include "lldb/lldb-private-interfaces.h"
@@ -260,58 +262,8 @@ public:
const OptionValueFormatEntity *GetAsFormatEntity() const;
- std::optional<bool> GetBooleanValue() const;
-
- bool SetBooleanValue(bool new_value);
-
- std::optional<char> GetCharValue() const;
-
- char SetCharValue(char new_value);
-
- std::optional<int64_t> GetEnumerationValue() const;
-
- bool SetEnumerationValue(int64_t value);
-
- std::optional<FileSpec> GetFileSpecValue() const;
-
- bool SetFileSpecValue(FileSpec file_spec);
-
bool AppendFileSpecValue(FileSpec file_spec);
- std::optional<FileSpecList> GetFileSpecListValue() const;
-
- std::optional<lldb::Format> GetFormatValue() const;
-
- bool SetFormatValue(lldb::Format new_value);
-
- std::optional<lldb::LanguageType> GetLanguageValue() const;
-
- bool SetLanguageValue(lldb::LanguageType new_language);
-
- const FormatEntity::Entry *GetFormatEntity() const;
-
- const RegularExpression *GetRegexValue() const;
-
- std::optional<int64_t> GetSInt64Value() const;
-
- bool SetSInt64Value(int64_t new_value);
-
- std::optional<llvm::StringRef> GetStringValue() const;
-
- bool SetStringValue(llvm::StringRef new_value);
-
- std::optional<uint64_t> GetUInt64Value() const;
-
- bool SetUInt64Value(uint64_t new_value);
-
- UUID GetUUIDValue() const;
-
- bool SetUUIDValue(const UUID &uuid);
-
- std::optional<ArchSpec> GetArchSpecValue() const;
-
- bool SetArchSpecValue(ArchSpec arch_spec);
-
bool OptionWasSet() const { return m_value_was_set; }
void SetOptionWasSet() { m_value_was_set = true; }
@@ -373,10 +325,20 @@ public:
bool SetValueAs(bool v) { return SetBooleanValue(v); }
+ bool SetValueAs(char v) { return SetCharValue(v); }
+
+ bool SetValueAs(uint64_t v) { return SetUInt64Value(v); }
+
+ bool SetValueAs(int64_t v) { return SetSInt64Value(v); }
+
+ bool SetValueAs(UUID v) { return SetUUIDValue(v); }
+
bool SetValueAs(llvm::StringRef v) { return SetStringValue(v); }
bool SetValueAs(lldb::LanguageType v) { return SetLanguageValue(v); }
+ bool SetValueAs(lldb::Format v) { return SetFormatValue(v); }
+
bool SetValueAs(FileSpec v) { return SetFileSpecValue(v); }
bool SetValueAs(ArchSpec v) { return SetArchSpecValue(v); }
@@ -401,6 +363,44 @@ protected:
// set from the command line or as a setting,
// versus if we just have the default value that
// was already populated in the option value.
+private:
+ std::optional<ArchSpec> GetArchSpecValue() const;
+ bool SetArchSpecValue(ArchSpec arch_spec);
+
+ std::optional<bool> GetBooleanValue() const;
+ bool SetBooleanValue(bool new_value);
+
+ std::optional<char> GetCharValue() const;
+ bool SetCharValue(char new_value);
+
+ std::optional<int64_t> GetEnumerationValue() const;
+ bool SetEnumerationValue(int64_t value);
+
+ std::optional<FileSpec> GetFileSpecValue() const;
+ bool SetFileSpecValue(FileSpec file_spec);
+
+ std::optional<FileSpecList> GetFileSpecListValue() const;
+
+ std::optional<int64_t> GetSInt64Value() const;
+ bool SetSInt64Value(int64_t new_value);
+
+ std::optional<uint64_t> GetUInt64Value() const;
+ bool SetUInt64Value(uint64_t new_value);
+
+ std::optional<lldb::Format> GetFormatValue() const;
+ bool SetFormatValue(lldb::Format new_value);
+
+ std::optional<lldb::LanguageType> GetLanguageValue() const;
+ bool SetLanguageValue(lldb::LanguageType new_language);
+
+ std::optional<llvm::StringRef> GetStringValue() const;
+ bool SetStringValue(llvm::StringRef new_value);
+
+ std::optional<UUID> GetUUIDValue() const;
+ bool SetUUIDValue(const UUID &uuid);
+
+ const FormatEntity::Entry *GetFormatEntity() const;
+ const RegularExpression *GetRegexValue() const;
};
} // namespace lldb_private