[lldb][NFCI] UUID::Dump should take a reference instead of a pointer

We always assume the Stream pointer is valid, might as well be taking a
reference instead.

Differential Revision: https://reviews.llvm.org/D153710
This commit is contained in:
Alex Langford
2023-06-24 12:23:43 -07:00
parent 55e199a2c9
commit 718e0cd6e7
7 changed files with 12 additions and 12 deletions

View File

@@ -194,7 +194,7 @@ public:
if (dumped_something)
strm.PutCString(", ");
strm.PutCString("uuid = ");
m_uuid.Dump(&strm);
m_uuid.Dump(strm);
dumped_something = true;
}
if (m_object_name) {

View File

@@ -61,7 +61,7 @@ public:
void Clear() { m_bytes.clear(); }
void Dump(Stream *s) const;
void Dump(Stream &s) const;
llvm::ArrayRef<uint8_t> GetBytes() const { return m_bytes; }

View File

@@ -1318,7 +1318,7 @@ static void DumpModuleArchitecture(Stream &strm, Module *module,
static void DumpModuleUUID(Stream &strm, Module *module) {
if (module && module->GetUUID().IsValid())
module->GetUUID().Dump(&strm);
module->GetUUID().Dump(strm);
else
strm.PutCString(" ");
}
@@ -2560,7 +2560,7 @@ protected:
return true;
} else {
StreamString strm;
module_spec.GetUUID().Dump(&strm);
module_spec.GetUUID().Dump(strm);
if (module_spec.GetFileSpec()) {
if (module_spec.GetSymbolFileSpec()) {
result.AppendErrorWithFormat(
@@ -2584,7 +2584,7 @@ protected:
}
} else {
StreamString strm;
module_spec.GetUUID().Dump(&strm);
module_spec.GetUUID().Dump(strm);
result.AppendErrorWithFormat(
"Unable to locate the executable or symbol file with UUID %s",
strm.GetData());
@@ -4240,7 +4240,7 @@ protected:
StreamString ss_symfile_uuid;
if (module_spec.GetUUID().IsValid()) {
ss_symfile_uuid << " (";
module_spec.GetUUID().Dump(&ss_symfile_uuid);
module_spec.GetUUID().Dump(ss_symfile_uuid);
ss_symfile_uuid << ')';
}
result.AppendErrorWithFormat(
@@ -4275,7 +4275,7 @@ protected:
if (!DownloadObjectAndSymbolFile(module_spec, result, flush)) {
StreamString error_strm;
error_strm.PutCString("unable to find debug symbols for UUID ");
module_spec.GetUUID().Dump(&error_strm);
module_spec.GetUUID().Dump(error_strm);
result.AppendError(error_strm.GetString());
return false;
}

View File

@@ -23,7 +23,7 @@ void OptionValueUUID::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
if (dump_mask & eDumpOptionValue) {
if (dump_mask & eDumpOptionType)
strm.PutCString(" = ");
m_uuid.Dump(&strm);
m_uuid.Dump(strm);
}
}

View File

@@ -54,11 +54,11 @@ static bool UUIDsMatch(Module *module, ObjectFile *ofile,
if (feedback_strm) {
feedback_strm->PutCString(
"warning: UUID mismatch detected between modules:\n ");
module->GetUUID().Dump(feedback_strm);
module->GetUUID().Dump(*feedback_strm);
feedback_strm->PutChar(' ');
module->GetFileSpec().Dump(feedback_strm->AsRawOstream());
feedback_strm->PutCString("\n ");
dsym_uuid.Dump(feedback_strm);
dsym_uuid.Dump(*feedback_strm);
feedback_strm->PutChar(' ');
ofile->GetFileSpec().Dump(feedback_strm->AsRawOstream());
feedback_strm->EOL();

View File

@@ -2271,7 +2271,7 @@ ModuleSP Target::GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
message << " (uuid ";
if (dump_uuid.IsValid())
dump_uuid.Dump(&message);
dump_uuid.Dump(message);
else
message << "not specified";

View File

@@ -61,7 +61,7 @@ std::string UUID::GetAsString(llvm::StringRef separator) const {
return result;
}
void UUID::Dump(Stream *s) const { s->PutCString(GetAsString()); }
void UUID::Dump(Stream &s) const { s.PutCString(GetAsString()); }
static inline int xdigit_to_int(char ch) {
ch = tolower(ch);