[Lldb-commits] [lldb] 49481b5 - Remove ConstString from Language, LanguageRuntime, SystemRuntime and SymbolFile plugin names
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 26 23:26:12 PDT 2021
Author: Pavel Labath
Date: 2021-10-27T08:25:44+02:00
New Revision: 49481b538065a0ba5ba1d7cc901eeceb8bf344c0
URL: https://github.com/llvm/llvm-project/commit/49481b538065a0ba5ba1d7cc901eeceb8bf344c0
DIFF: https://github.com/llvm/llvm-project/commit/49481b538065a0ba5ba1d7cc901eeceb8bf344c0.diff
LOG: Remove ConstString from Language, LanguageRuntime, SystemRuntime and SymbolFile plugin names
Added:
Modified:
lldb/include/lldb/Core/PluginManager.h
lldb/source/Core/PluginManager.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h
lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h
index aa51069cf4539..e027968c1b4d4 100644
--- a/lldb/include/lldb/Core/PluginManager.h
+++ b/lldb/include/lldb/Core/PluginManager.h
@@ -134,7 +134,7 @@ class PluginManager {
GetOperatingSystemCreateCallbackForPluginName(llvm::StringRef name);
// Language
- static bool RegisterPlugin(ConstString name, const char *description,
+ static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
LanguageCreateInstance create_callback);
static bool UnregisterPlugin(LanguageCreateInstance create_callback);
@@ -143,7 +143,7 @@ class PluginManager {
// LanguageRuntime
static bool RegisterPlugin(
- ConstString name, const char *description,
+ llvm::StringRef name, llvm::StringRef description,
LanguageRuntimeCreateInstance create_callback,
LanguageRuntimeGetCommandObject command_callback = nullptr,
LanguageRuntimeGetExceptionPrecondition precondition_callback = nullptr);
@@ -160,7 +160,7 @@ class PluginManager {
GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx);
// SystemRuntime
- static bool RegisterPlugin(ConstString name, const char *description,
+ static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
SystemRuntimeCreateInstance create_callback);
static bool UnregisterPlugin(SystemRuntimeCreateInstance create_callback);
@@ -314,7 +314,7 @@ class PluginManager {
// SymbolFile
static bool
- RegisterPlugin(ConstString name, const char *description,
+ RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
SymbolFileCreateInstance create_callback,
DebuggerInitializeCallback debugger_init_callback = nullptr);
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index fdf2aa7da4b32..db603c1160902 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -514,10 +514,11 @@ static LanguageInstances &GetLanguageInstances() {
return g_instances;
}
-bool PluginManager::RegisterPlugin(ConstString name, const char *description,
+bool PluginManager::RegisterPlugin(llvm::StringRef name,
+ llvm::StringRef description,
LanguageCreateInstance create_callback) {
- return GetLanguageInstances().RegisterPlugin(name, description,
- create_callback);
+ return GetLanguageInstances().RegisterPlugin(
+ ConstString(name), description.str().c_str(), create_callback);
}
bool PluginManager::UnregisterPlugin(LanguageCreateInstance create_callback) {
@@ -534,7 +535,8 @@ PluginManager::GetLanguageCreateCallbackAtIndex(uint32_t idx) {
struct LanguageRuntimeInstance
: public PluginInstance<LanguageRuntimeCreateInstance> {
LanguageRuntimeInstance(
- ConstString name, std::string description, CallbackType create_callback,
+ ConstString name, std::string description,
+ CallbackType create_callback,
DebuggerInitializeCallback debugger_init_callback,
LanguageRuntimeGetCommandObject command_callback,
LanguageRuntimeGetExceptionPrecondition precondition_callback)
@@ -556,13 +558,13 @@ static LanguageRuntimeInstances &GetLanguageRuntimeInstances() {
}
bool PluginManager::RegisterPlugin(
- ConstString name, const char *description,
+ llvm::StringRef name, llvm::StringRef description,
LanguageRuntimeCreateInstance create_callback,
LanguageRuntimeGetCommandObject command_callback,
LanguageRuntimeGetExceptionPrecondition precondition_callback) {
return GetLanguageRuntimeInstances().RegisterPlugin(
- name, description, create_callback, nullptr, command_callback,
- precondition_callback);
+ ConstString(name), description.str().c_str(), create_callback, nullptr,
+ command_callback, precondition_callback);
}
bool PluginManager::UnregisterPlugin(
@@ -602,10 +604,10 @@ static SystemRuntimeInstances &GetSystemRuntimeInstances() {
}
bool PluginManager::RegisterPlugin(
- ConstString name, const char *description,
+ llvm::StringRef name, llvm::StringRef description,
SystemRuntimeCreateInstance create_callback) {
- return GetSystemRuntimeInstances().RegisterPlugin(name, description,
- create_callback);
+ return GetSystemRuntimeInstances().RegisterPlugin(
+ ConstString(name), description.str().c_str(), create_callback);
}
bool PluginManager::UnregisterPlugin(
@@ -990,11 +992,12 @@ static SymbolFileInstances &GetSymbolFileInstances() {
}
bool PluginManager::RegisterPlugin(
- ConstString name, const char *description,
+ llvm::StringRef name, llvm::StringRef description,
SymbolFileCreateInstance create_callback,
DebuggerInitializeCallback debugger_init_callback) {
return GetSymbolFileInstances().RegisterPlugin(
- name, description, create_callback, debugger_init_callback);
+ ConstString(name), description.str().c_str(), create_callback,
+ debugger_init_callback);
}
bool PluginManager::UnregisterPlugin(SymbolFileCreateInstance create_callback) {
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index 240bbecfc2c53..03e3e46523085 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -56,11 +56,6 @@ void CPlusPlusLanguage::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString CPlusPlusLanguage::GetPluginNameStatic() {
- static ConstString g_name("cplusplus");
- return g_name;
-}
-
bool CPlusPlusLanguage::SymbolNameFitsToLanguage(Mangled mangled) const {
const char *mangled_name = mangled.GetMangledName().GetCString();
return mangled_name && CPlusPlusLanguage::IsCPPMangledName(mangled_name);
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
index eebb4093a91e8..5547864a37639 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
@@ -102,7 +102,7 @@ class CPlusPlusLanguage : public Language {
static lldb_private::Language *CreateInstance(lldb::LanguageType language);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "cplusplus"; }
bool SymbolNameFitsToLanguage(Mangled mangled) const override;
@@ -134,9 +134,7 @@ class CPlusPlusLanguage : public Language {
const Mangled mangled, const SymbolContext &sym_ctx) const override;
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
};
} // namespace lldb_private
diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
index 7aeaf7aebc1a7..99ce389bb53ec 100644
--- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
+++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
@@ -48,11 +48,6 @@ void ObjCLanguage::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString ObjCLanguage::GetPluginNameStatic() {
- static ConstString g_name("objc");
- return g_name;
-}
-
// Static Functions
Language *ObjCLanguage::CreateInstance(lldb::LanguageType language) {
diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h
index bc35cbe1ebcc1..914452086db7a 100644
--- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h
+++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h
@@ -133,7 +133,7 @@ class ObjCLanguage : public Language {
static lldb_private::Language *CreateInstance(lldb::LanguageType language);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "objc"; }
static bool IsPossibleObjCMethodName(const char *name) {
if (!name)
@@ -156,9 +156,7 @@ class ObjCLanguage : public Language {
}
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
};
} // namespace lldb_private
diff --git a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
index 2aa49add70eff..700dda3d33bb0 100644
--- a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
@@ -34,11 +34,6 @@ void ObjCPlusPlusLanguage::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString ObjCPlusPlusLanguage::GetPluginNameStatic() {
- static ConstString g_name("objcplusplus");
- return g_name;
-}
-
// Static Functions
Language *ObjCPlusPlusLanguage::CreateInstance(lldb::LanguageType language) {
switch (language) {
diff --git a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
index 9d093723b0a17..20184fd709d5c 100644
--- a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
+++ b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
@@ -40,12 +40,10 @@ class ObjCPlusPlusLanguage : public Language {
static lldb_private::Language *CreateInstance(lldb::LanguageType language);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "objcplusplus"; }
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
};
} // namespace lldb_private
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index d6048fbf7cbf4..92f732fe6827e 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -405,11 +405,6 @@ void ItaniumABILanguageRuntime::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginNameStatic() {
- static ConstString g_name("itanium");
- return g_name;
-}
-
BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
const BreakpointSP &bkpt, bool catch_bp, bool throw_bp) {
return CreateExceptionResolver(bkpt, catch_bp, throw_bp, false);
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
index 7b37cf8658e77..ca8d5ab1a93a1 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
@@ -35,7 +35,7 @@ class ItaniumABILanguageRuntime : public lldb_private::CPPLanguageRuntime {
static lldb_private::LanguageRuntime *
CreateInstance(Process *process, lldb::LanguageType language);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "itanium"; }
static char ID;
@@ -76,9 +76,7 @@ class ItaniumABILanguageRuntime : public lldb_private::CPPLanguageRuntime {
lldb::ThreadSP thread_sp) override;
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
protected:
lldb::BreakpointResolverSP
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
index 1fb872ff89e16..609e8e9bc1b6a 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
@@ -92,11 +92,6 @@ void AppleObjCRuntimeV1::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString AppleObjCRuntimeV1::GetPluginNameStatic() {
- static ConstString g_name("apple-objc-v1");
- return g_name;
-}
-
BreakpointResolverSP
AppleObjCRuntimeV1::CreateExceptionResolver(const BreakpointSP &bkpt,
bool catch_bp, bool throw_bp) {
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
index 26449b5b22841..46d8e89c906e3 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
@@ -28,7 +28,7 @@ class AppleObjCRuntimeV1 : public AppleObjCRuntime {
static lldb_private::LanguageRuntime *
CreateInstance(Process *process, lldb::LanguageType language);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "apple-objc-v1"; }
static char ID;
@@ -107,9 +107,7 @@ class AppleObjCRuntimeV1 : public AppleObjCRuntime {
CreateObjectChecker(std::string, ExecutionContext &exe_ctx) override;
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
ObjCRuntimeVersions GetRuntimeVersion() const override {
return ObjCRuntimeVersions::eAppleObjC_V1;
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 091bd3752d072..240b458c21ea3 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -1061,11 +1061,6 @@ void AppleObjCRuntimeV2::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString AppleObjCRuntimeV2::GetPluginNameStatic() {
- static ConstString g_name("apple-objc-v2");
- return g_name;
-}
-
BreakpointResolverSP
AppleObjCRuntimeV2::CreateExceptionResolver(const BreakpointSP &bkpt,
bool catch_bp, bool throw_bp) {
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
index 8ea4cf9b48af5..6266634e64c56 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
@@ -33,7 +33,7 @@ class AppleObjCRuntimeV2 : public AppleObjCRuntime {
static lldb_private::LanguageRuntime *
CreateInstance(Process *process, lldb::LanguageType language);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "apple-objc-v2"; }
static char ID;
@@ -54,9 +54,7 @@ class AppleObjCRuntimeV2 : public AppleObjCRuntime {
llvm::Expected<std::unique_ptr<UtilityFunction>>
CreateObjectChecker(std::string name, ExecutionContext &exe_ctx) override;
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
ObjCRuntimeVersions GetRuntimeVersion() const override {
return ObjCRuntimeVersions::eAppleObjC_V2;
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index 517d160e4d274..d6de65809c188 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -966,11 +966,6 @@ void RenderScriptRuntime::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString RenderScriptRuntime::GetPluginNameStatic() {
- static ConstString plugin_name("renderscript");
- return plugin_name;
-}
-
RenderScriptRuntime::ModuleKind
RenderScriptRuntime::GetModuleKind(const lldb::ModuleSP &module_sp) {
if (module_sp) {
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
index 66553fddc4ec0..4ddf996dedb2f 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
@@ -318,7 +318,7 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime {
static lldb::CommandObjectSP
GetCommandObject(CommandInterpreter &interpreter);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "renderscript"; }
static char ID;
@@ -410,9 +410,7 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime {
bool GetOverrideExprOptions(clang::TargetOptions &prototype);
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
static bool GetKernelCoordinate(lldb_renderscript::RSCoordinate &coord,
Thread *thread_ptr);
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
index 243af5e356dcc..ef11ed2a39415 100644
--- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
+++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
@@ -176,11 +176,6 @@ void SymbolFileBreakpad::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-ConstString SymbolFileBreakpad::GetPluginNameStatic() {
- static ConstString g_name("breakpad");
- return g_name;
-}
-
uint32_t SymbolFileBreakpad::CalculateAbilities() {
if (!m_objfile_sp || !llvm::isa<ObjectFileBreakpad>(*m_objfile_sp))
return 0;
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
index 36ce53663acbe..2f7b8226f76bc 100644
--- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
+++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
@@ -37,9 +37,9 @@ class SymbolFileBreakpad : public SymbolFile {
static void Initialize();
static void Terminate();
static void DebuggerInitialize(Debugger &debugger) {}
- static ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "breakpad"; }
- static const char *GetPluginDescriptionStatic() {
+ static llvm::StringRef GetPluginDescriptionStatic() {
return "Breakpad debug symbol file reader.";
}
@@ -146,9 +146,7 @@ class SymbolFileBreakpad : public SymbolFile {
GetUnwindPlan(const Address &address,
const RegisterInfoResolver &resolver) override;
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
uint64_t GetDebugInfoSize() override;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 21f52f0b6630f..205b03464534c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -131,7 +131,7 @@ enum {
class PluginProperties : public Properties {
public:
static ConstString GetSettingName() {
- return SymbolFileDWARF::GetPluginNameStatic();
+ return ConstString(SymbolFileDWARF::GetPluginNameStatic());
}
PluginProperties() {
@@ -277,12 +277,7 @@ void SymbolFileDWARF::Terminate() {
LogChannelDWARF::Terminate();
}
-lldb_private::ConstString SymbolFileDWARF::GetPluginNameStatic() {
- static ConstString g_name("dwarf");
- return g_name;
-}
-
-const char *SymbolFileDWARF::GetPluginDescriptionStatic() {
+llvm::StringRef SymbolFileDWARF::GetPluginDescriptionStatic() {
return "DWARF and DWARF3 debug symbol file reader.";
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 4d6fccdd9ebd9..271ce7be1eeaf 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -84,9 +84,9 @@ class SymbolFileDWARF : public lldb_private::SymbolFile,
static void DebuggerInitialize(lldb_private::Debugger &debugger);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "dwarf"; }
- static const char *GetPluginDescriptionStatic();
+ static llvm::StringRef GetPluginDescriptionStatic();
static lldb_private::SymbolFile *
CreateInstance(lldb::ObjectFileSP objfile_sp);
@@ -219,9 +219,7 @@ class SymbolFileDWARF : public lldb_private::SymbolFile,
std::recursive_mutex &GetModuleMutex() const override;
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
DWARFDebugAbbrev *DebugAbbrev();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index a58696b70daf9..2491f6af8c19e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -228,12 +228,7 @@ void SymbolFileDWARFDebugMap::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString SymbolFileDWARFDebugMap::GetPluginNameStatic() {
- static ConstString g_name("dwarf-debugmap");
- return g_name;
-}
-
-const char *SymbolFileDWARFDebugMap::GetPluginDescriptionStatic() {
+llvm::StringRef SymbolFileDWARFDebugMap::GetPluginDescriptionStatic() {
return "DWARF and DWARF3 debug symbol file reader (debug map).";
}
@@ -528,8 +523,8 @@ SymbolFileDWARFDebugMap::GetSymbolFileByOSOIndex(uint32_t oso_idx) {
SymbolFileDWARF *
SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file) {
- if (sym_file && sym_file->GetPluginName() ==
- SymbolFileDWARF::GetPluginNameStatic().GetStringRef())
+ if (sym_file &&
+ sym_file->GetPluginName() == SymbolFileDWARF::GetPluginNameStatic())
return static_cast<SymbolFileDWARF *>(sym_file);
return nullptr;
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
index 89da4e8645bac..74f32442de2f0 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -40,9 +40,9 @@ class SymbolFileDWARFDebugMap : public lldb_private::SymbolFile {
static void Terminate();
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "dwarf-debugmap"; }
- static const char *GetPluginDescriptionStatic();
+ static llvm::StringRef GetPluginDescriptionStatic();
static lldb_private::SymbolFile *
CreateInstance(lldb::ObjectFileSP objfile_sp);
@@ -140,9 +140,7 @@ class SymbolFileDWARFDebugMap : public lldb_private::SymbolFile {
void DumpClangAST(lldb_private::Stream &s) override;
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
uint64_t GetDebugInfoSize() override;
lldb_private::StatsDuration GetDebugInfoParseTime() override;
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index 152d8f78f91fc..7a734c9c60d9e 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -240,12 +240,7 @@ void SymbolFileNativePDB::Terminate() {
void SymbolFileNativePDB::DebuggerInitialize(Debugger &debugger) {}
-ConstString SymbolFileNativePDB::GetPluginNameStatic() {
- static ConstString g_name("native-pdb");
- return g_name;
-}
-
-const char *SymbolFileNativePDB::GetPluginDescriptionStatic() {
+llvm::StringRef SymbolFileNativePDB::GetPluginDescriptionStatic() {
return "Microsoft PDB debug symbol cross-platform file reader.";
}
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
index c19875e1a9dbe..56a5ec0a464d7 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
@@ -60,9 +60,9 @@ class SymbolFileNativePDB : public SymbolFile {
static void DebuggerInitialize(Debugger &debugger);
- static ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "native-pdb"; }
- static const char *GetPluginDescriptionStatic();
+ static llvm::StringRef GetPluginDescriptionStatic();
static SymbolFile *CreateInstance(lldb::ObjectFileSP objfile_sp);
@@ -153,9 +153,7 @@ class SymbolFileNativePDB : public SymbolFile {
FindNamespace(ConstString name,
const CompilerDeclContext &parent_decl_ctx) override;
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
llvm::pdb::PDBFile &GetPDBFile() { return m_index->pdb(); }
const llvm::pdb::PDBFile &GetPDBFile() const { return m_index->pdb(); }
diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
index f6e34285138ce..45dfc4b9a1525 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -119,12 +119,7 @@ void SymbolFilePDB::Terminate() {
void SymbolFilePDB::DebuggerInitialize(lldb_private::Debugger &debugger) {}
-lldb_private::ConstString SymbolFilePDB::GetPluginNameStatic() {
- static ConstString g_name("pdb");
- return g_name;
-}
-
-const char *SymbolFilePDB::GetPluginDescriptionStatic() {
+llvm::StringRef SymbolFilePDB::GetPluginDescriptionStatic() {
return "Microsoft PDB debug symbol file reader.";
}
diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
index 67e309fb9a963..69f1d268edfd7 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
+++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
@@ -41,9 +41,9 @@ class SymbolFilePDB : public lldb_private::SymbolFile {
static void DebuggerInitialize(lldb_private::Debugger &debugger);
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "pdb"; }
- static const char *GetPluginDescriptionStatic();
+ static llvm::StringRef GetPluginDescriptionStatic();
static lldb_private::SymbolFile *
CreateInstance(lldb::ObjectFileSP objfile_sp);
@@ -161,9 +161,7 @@ class SymbolFilePDB : public lldb_private::SymbolFile {
lldb_private::ConstString name,
const lldb_private::CompilerDeclContext &parent_decl_ctx) override;
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
llvm::pdb::IPDBSession &GetPDBSession();
diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
index e3358b290d77e..d95cfea5e8729 100644
--- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
+++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
@@ -38,12 +38,7 @@ void SymbolFileSymtab::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString SymbolFileSymtab::GetPluginNameStatic() {
- static ConstString g_name("symtab");
- return g_name;
-}
-
-const char *SymbolFileSymtab::GetPluginDescriptionStatic() {
+llvm::StringRef SymbolFileSymtab::GetPluginDescriptionStatic() {
return "Reads debug symbols from an object file's symbol table.";
}
diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
index 11475b0c66ece..2dad12baac6f6 100644
--- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
+++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
@@ -36,9 +36,9 @@ class SymbolFileSymtab : public lldb_private::SymbolFile {
static void Terminate();
- static lldb_private::ConstString GetPluginNameStatic();
+ static llvm::StringRef GetPluginNameStatic() { return "symtab"; }
- static const char *GetPluginDescriptionStatic();
+ static llvm::StringRef GetPluginDescriptionStatic();
static lldb_private::SymbolFile *
CreateInstance(lldb::ObjectFileSP objfile_sp);
@@ -85,9 +85,7 @@ class SymbolFileSymtab : public lldb_private::SymbolFile {
lldb_private::TypeList &type_list) override;
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
protected:
uint32_t CalculateNumCompileUnits() override;
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
index 262ec8767a802..a490829a548bb 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -976,19 +976,11 @@ SystemRuntimeMacOSX::ItemInfo SystemRuntimeMacOSX::ExtractItemInfoFromBuffer(
}
void SystemRuntimeMacOSX::Initialize() {
- PluginManager::RegisterPlugin(GetPluginNameStatic(),
- GetPluginDescriptionStatic(), CreateInstance);
+ PluginManager::RegisterPlugin(
+ GetPluginNameStatic(),
+ "System runtime plugin for Mac OS X native libraries.", CreateInstance);
}
void SystemRuntimeMacOSX::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-
-lldb_private::ConstString SystemRuntimeMacOSX::GetPluginNameStatic() {
- static ConstString g_name("systemruntime-macosx");
- return g_name;
-}
-
-const char *SystemRuntimeMacOSX::GetPluginDescriptionStatic() {
- return "System runtime plugin for Mac OS X native libraries.";
-}
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h
index 1ac8569854b12..88c36a5b0af32 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h
@@ -39,9 +39,9 @@ class SystemRuntimeMacOSX : public lldb_private::SystemRuntime {
static void Terminate();
- static lldb_private::ConstString GetPluginNameStatic();
-
- static const char *GetPluginDescriptionStatic();
+ static llvm::StringRef GetPluginNameStatic() {
+ return "systemruntime-macosx";
+ }
static lldb_private::SystemRuntime *
CreateInstance(lldb_private::Process *process);
@@ -98,9 +98,7 @@ class SystemRuntimeMacOSX : public lldb_private::SystemRuntime {
bool SafeToCallFunctionsOnThisThread(lldb::ThreadSP thread_sp) override;
// PluginInterface protocol
- llvm::StringRef GetPluginName() override {
- return GetPluginNameStatic().GetStringRef();
- }
+ llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
protected:
lldb::user_id_t m_break_id;
diff --git a/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp b/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
index da5036ed4c770..92fb798d5d481 100644
--- a/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
+++ b/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
@@ -62,8 +62,7 @@ TEST_F(SymbolFileDWARFTests, TestAbilitiesForDWARF) {
SymbolFile *symfile = module->GetSymbolFile();
ASSERT_NE(nullptr, symfile);
- EXPECT_EQ(symfile->GetPluginName(),
- SymbolFileDWARF::GetPluginNameStatic().GetStringRef());
+ EXPECT_EQ(symfile->GetPluginName(), SymbolFileDWARF::GetPluginNameStatic());
uint32_t expected_abilities = SymbolFile::kAllAbilities;
EXPECT_EQ(expected_abilities, symfile->CalculateAbilities());
diff --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index d84980149d23e..7c7d1902eefb9 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -153,8 +153,7 @@ TEST_F(SymbolFilePDBTests, TestAbilitiesForPDB) {
SymbolFile *symfile = module->GetSymbolFile();
EXPECT_NE(nullptr, symfile);
- EXPECT_EQ(symfile->GetPluginName(),
- SymbolFilePDB::GetPluginNameStatic().GetStringRef());
+ EXPECT_EQ(symfile->GetPluginName(), SymbolFilePDB::GetPluginNameStatic());
uint32_t expected_abilities = SymbolFile::kAllAbilities;
EXPECT_EQ(expected_abilities, symfile->CalculateAbilities());
More information about the lldb-commits
mailing list