This revision was automatically updated to reflect the committed changes.
Closed by commit rG3cff6ca81335: [lldb][NFCI] Change return type of
Properties::GetExperimentalSettingsName (authored by bulbazord).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151951/new/
https://reviews.llvm.org/D151951
Files:
lldb/include/lldb/Core/UserSettingsController.h
lldb/source/Core/UserSettingsController.cpp
lldb/source/Interpreter/OptionValueProperties.cpp
Index: lldb/source/Interpreter/OptionValueProperties.cpp
===================================================================
--- lldb/source/Interpreter/OptionValueProperties.cpp
+++ lldb/source/Interpreter/OptionValueProperties.cpp
@@ -88,8 +88,8 @@
value_sp->GetSubValue(exe_ctx, sub_name.drop_front(), error);
if (!return_val_sp) {
if (Properties::IsSettingExperimental(sub_name.drop_front())) {
- size_t experimental_len =
- strlen(Properties::GetExperimentalSettingsName());
+ const size_t experimental_len =
+ Properties::GetExperimentalSettingsName().size();
if (sub_name[experimental_len + 1] == '.')
return_val_sp = value_sp->GetSubValue(
exe_ctx, sub_name.drop_front(experimental_len + 2), error);
Index: lldb/source/Core/UserSettingsController.cpp
===================================================================
--- lldb/source/Core/UserSettingsController.cpp
+++ lldb/source/Core/UserSettingsController.cpp
@@ -107,7 +107,10 @@
return lldb::OptionValuePropertiesSP();
}
-const char *Properties::GetExperimentalSettingsName() { return "experimental";
}
+llvm::StringRef Properties::GetExperimentalSettingsName() {
+ static constexpr llvm::StringLiteral g_experimental("experimental");
+ return g_experimental;
+}
bool Properties::IsSettingExperimental(llvm::StringRef setting) {
if (setting.empty())
Index: lldb/include/lldb/Core/UserSettingsController.h
===================================================================
--- lldb/include/lldb/Core/UserSettingsController.h
+++ lldb/include/lldb/Core/UserSettingsController.h
@@ -79,7 +79,7 @@
// don't find the name will not be treated as errors. Also, if you decide to
// keep the settings just move them into the containing properties, and we
// will auto-forward the experimental settings to the real one.
- static const char *GetExperimentalSettingsName();
+ static llvm::StringRef GetExperimentalSettingsName();
static bool IsSettingExperimental(llvm::StringRef setting);
Index: lldb/source/Interpreter/OptionValueProperties.cpp
===================================================================
--- lldb/source/Interpreter/OptionValueProperties.cpp
+++ lldb/source/Interpreter/OptionValueProperties.cpp
@@ -88,8 +88,8 @@
value_sp->GetSubValue(exe_ctx, sub_name.drop_front(), error);
if (!return_val_sp) {
if (Properties::IsSettingExperimental(sub_name.drop_front())) {
- size_t experimental_len =
- strlen(Properties::GetExperimentalSettingsName());
+ const size_t experimental_len =
+ Properties::GetExperimentalSettingsName().size();
if (sub_name[experimental_len + 1] == '.')
return_val_sp = value_sp->GetSubValue(
exe_ctx, sub_name.drop_front(experimental_len + 2), error);
Index: lldb/source/Core/UserSettingsController.cpp
===================================================================
--- lldb/source/Core/UserSettingsController.cpp
+++ lldb/source/Core/UserSettingsController.cpp
@@ -107,7 +107,10 @@
return lldb::OptionValuePropertiesSP();
}
-const char *Properties::GetExperimentalSettingsName() { return "experimental"; }
+llvm::StringRef Properties::GetExperimentalSettingsName() {
+ static constexpr llvm::StringLiteral g_experimental("experimental");
+ return g_experimental;
+}
bool Properties::IsSettingExperimental(llvm::StringRef setting) {
if (setting.empty())
Index: lldb/include/lldb/Core/UserSettingsController.h
===================================================================
--- lldb/include/lldb/Core/UserSettingsController.h
+++ lldb/include/lldb/Core/UserSettingsController.h
@@ -79,7 +79,7 @@
// don't find the name will not be treated as errors. Also, if you decide to
// keep the settings just move them into the containing properties, and we
// will auto-forward the experimental settings to the real one.
- static const char *GetExperimentalSettingsName();
+ static llvm::StringRef GetExperimentalSettingsName();
static bool IsSettingExperimental(llvm::StringRef setting);
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits