[Lldb-commits] [lldb] r335246 - Remove UUID::SetFromCString
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 21 08:24:39 PDT 2018
Author: labath
Date: Thu Jun 21 08:24:39 2018
New Revision: 335246
URL: http://llvm.org/viewvc/llvm-project?rev=335246&view=rev
Log:
Remove UUID::SetFromCString
Replace uses with SetFromStringRef. NFC.
Modified:
lldb/trunk/include/lldb/Utility/UUID.h
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Interpreter/OptionValueUUID.cpp
lldb/trunk/source/Interpreter/Property.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/trunk/source/Utility/UUID.cpp
lldb/trunk/unittests/Target/ModuleCacheTest.cpp
Modified: lldb/trunk/include/lldb/Utility/UUID.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/UUID.h?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/UUID.h (original)
+++ lldb/trunk/include/lldb/Utility/UUID.h Thu Jun 21 08:24:39 2018
@@ -56,7 +56,6 @@ public:
std::string GetAsString(const char *separator = nullptr) const;
size_t SetFromStringRef(llvm::StringRef str, uint32_t num_uuid_bytes = 16);
- size_t SetFromCString(const char *c_str, uint32_t num_uuid_bytes = 16);
// Decode as many UUID bytes (up to 16) as possible from the C string "cstr"
// This is used for auto completion where a partial UUID might have been
Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Thu Jun 21 08:24:39 2018
@@ -1472,7 +1472,7 @@ lldb::SBModule SBTarget::AddModule(const
module_spec.GetFileSpec().SetFile(path, false, FileSpec::Style::native);
if (uuid_cstr)
- module_spec.GetUUID().SetFromCString(uuid_cstr);
+ module_spec.GetUUID().SetFromStringRef(uuid_cstr);
if (triple)
module_spec.GetArchitecture() = Platform::GetAugmentedArchSpec(
Modified: lldb/trunk/source/Interpreter/OptionValueUUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueUUID.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueUUID.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueUUID.cpp Thu Jun 21 08:24:39 2018
@@ -43,7 +43,7 @@ Status OptionValueUUID::SetValueFromStri
case eVarSetOperationReplace:
case eVarSetOperationAssign: {
- if (m_uuid.SetFromCString(value.str().c_str()) == 0)
+ if (m_uuid.SetFromStringRef(value) == 0)
error.SetErrorStringWithFormat("invalid uuid string value '%s'",
value.str().c_str());
else {
Modified: lldb/trunk/source/Interpreter/Property.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Property.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Property.cpp (original)
+++ lldb/trunk/source/Interpreter/Property.cpp Thu Jun 21 08:24:39 2018
@@ -194,7 +194,7 @@ Property::Property(const PropertyDefinit
{
UUID uuid;
if (definition.default_cstr_value)
- uuid.SetFromCString(definition.default_cstr_value);
+ uuid.SetFromStringRef(definition.default_cstr_value);
m_value_sp.reset(new OptionValueUUID(uuid));
}
break;
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp Thu Jun 21 08:24:39 2018
@@ -484,7 +484,7 @@ bool DynamicLoaderMacOS::GetSharedCacheI
std::string uuid_str =
info_dict->GetValueForKey("shared_cache_uuid")->GetStringValue();
if (!uuid_str.empty())
- uuid.SetFromCString(uuid_str.c_str());
+ uuid.SetFromStringRef(uuid_str);
if (info_dict->GetValueForKey("no_shared_cache")->GetBooleanValue() ==
false)
using_shared_cache = eLazyBoolYes;
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Thu Jun 21 08:24:39 2018
@@ -456,7 +456,7 @@ lldb_private::UUID CommunicationKDP::Get
if (uuid_str.size() < 32)
return uuid;
- if (uuid.SetFromCString(uuid_str.c_str()) == 0) {
+ if (uuid.SetFromStringRef(uuid_str) == 0) {
UUID invalid_uuid;
return invalid_uuid;
}
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Jun 21 08:24:39 2018
@@ -3541,7 +3541,7 @@ bool GDBRemoteCommunicationClient::GetMo
StringExtractor extractor(value);
std::string uuid;
extractor.GetHexByteString(uuid);
- module_spec.GetUUID().SetFromCString(uuid.c_str(), uuid.size() / 2);
+ module_spec.GetUUID().SetFromStringRef(uuid, uuid.size() / 2);
} else if (name == "triple") {
StringExtractor extractor(value);
std::string triple;
Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Thu Jun 21 08:24:39 2018
@@ -314,7 +314,7 @@ Status ProcessMachCore::DoLoadCore() {
if (corefile_identifier.find("UUID=") != std::string::npos) {
size_t p = corefile_identifier.find("UUID=") + strlen("UUID=");
std::string uuid_str = corefile_identifier.substr(p, 36);
- uuid.SetFromCString(uuid_str.c_str());
+ uuid.SetFromStringRef(uuid_str);
}
if (corefile_identifier.find("stext=") != std::string::npos) {
size_t p = corefile_identifier.find("stext=") + strlen("stext=");
Modified: lldb/trunk/source/Utility/UUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/UUID.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/source/Utility/UUID.cpp (original)
+++ lldb/trunk/source/Utility/UUID.cpp Thu Jun 21 08:24:39 2018
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <string.h>
-namespace lldb_private {
+using namespace lldb_private;
UUID::UUID() { Clear(); }
@@ -170,14 +170,6 @@ size_t UUID::SetFromStringRef(llvm::Stri
return 0;
}
-size_t UUID::SetFromCString(const char *cstr, uint32_t num_uuid_bytes) {
- if (cstr == NULL)
- return 0;
-
- return SetFromStringRef(cstr, num_uuid_bytes);
-}
-}
-
bool lldb_private::operator==(const lldb_private::UUID &lhs,
const lldb_private::UUID &rhs) {
return lhs.GetBytes() == rhs.GetBytes();
Modified: lldb/trunk/unittests/Target/ModuleCacheTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Target/ModuleCacheTest.cpp?rev=335246&r1=335245&r2=335246&view=diff
==============================================================================
--- lldb/trunk/unittests/Target/ModuleCacheTest.cpp (original)
+++ lldb/trunk/unittests/Target/ModuleCacheTest.cpp Thu Jun 21 08:24:39 2018
@@ -93,7 +93,7 @@ void ModuleCacheTest::TryGetAndPut(const
ModuleCache mc;
ModuleSpec module_spec;
module_spec.GetFileSpec() = GetDummyRemotePath();
- module_spec.GetUUID().SetFromCString(module_uuid, uuid_bytes);
+ module_spec.GetUUID().SetFromStringRef(module_uuid, uuid_bytes);
module_spec.SetObjectSize(module_size);
ModuleSP module_sp;
bool did_create;
More information about the lldb-commits
mailing list