summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-12-04 09:20:42 +0100
committerRaphael Isemann <teemperor@gmail.com>2019-12-04 09:35:50 +0100
commitc4c464f8a5025ad59733723e1ba1900837760078 (patch)
treefd0c49e5b79b51e22b1153c12401cc2df41738e2 /lldb/source/Core/Module.cpp
parentd8136f14f125fb27f2326f397df0964bf62078ca (diff)
downloadbcm5719-llvm-c4c464f8a5025ad59733723e1ba1900837760078.tar.gz
bcm5719-llvm-c4c464f8a5025ad59733723e1ba1900837760078.zip
[lldb][NFC] Migrate to raw_ostream in Module::GetDescription
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 360c8c13454..a8a92bb5b1f 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1061,34 +1061,35 @@ std::string Module::GetSpecificationDescription() const {
return spec;
}
-void Module::GetDescription(Stream *s, lldb::DescriptionLevel level) {
+void Module::GetDescription(llvm::raw_ostream &s,
+ lldb::DescriptionLevel level) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (level >= eDescriptionLevelFull) {
if (m_arch.IsValid())
- s->Printf("(%s) ", m_arch.GetArchitectureName());
+ s << llvm::formatv("({0}) ", m_arch.GetArchitectureName());
}
if (level == eDescriptionLevelBrief) {
const char *filename = m_file.GetFilename().GetCString();
if (filename)
- s->PutCString(filename);
+ s << filename;
} else {
char path[PATH_MAX];
if (m_file.GetPath(path, sizeof(path)))
- s->PutCString(path);
+ s << path;
}
const char *object_name = m_object_name.GetCString();
if (object_name)
- s->Printf("(%s)", object_name);
+ s << llvm::formatv("({0})", object_name);
}
void Module::ReportError(const char *format, ...) {
if (format && format[0]) {
StreamString strm;
strm.PutCString("error: ");
- GetDescription(&strm, lldb::eDescriptionLevelBrief);
+ GetDescription(strm.AsRawOstream(), lldb::eDescriptionLevelBrief);
strm.PutChar(' ');
va_list args;
va_start(args, format);
@@ -1119,7 +1120,7 @@ void Module::ReportErrorIfModifyDetected(const char *format, ...) {
if (format) {
StreamString strm;
strm.PutCString("error: the object file ");
- GetDescription(&strm, lldb::eDescriptionLevelFull);
+ GetDescription(strm.AsRawOstream(), lldb::eDescriptionLevelFull);
strm.PutCString(" has been modified\n");
va_list args;
@@ -1145,7 +1146,7 @@ void Module::ReportWarning(const char *format, ...) {
if (format && format[0]) {
StreamString strm;
strm.PutCString("warning: ");
- GetDescription(&strm, lldb::eDescriptionLevelFull);
+ GetDescription(strm.AsRawOstream(), lldb::eDescriptionLevelFull);
strm.PutChar(' ');
va_list args;
@@ -1166,7 +1167,7 @@ void Module::ReportWarning(const char *format, ...) {
void Module::LogMessage(Log *log, const char *format, ...) {
if (log != nullptr) {
StreamString log_message;
- GetDescription(&log_message, lldb::eDescriptionLevelFull);
+ GetDescription(log_message.AsRawOstream(), lldb::eDescriptionLevelFull);
log_message.PutCString(": ");
va_list args;
va_start(args, format);
@@ -1179,7 +1180,7 @@ void Module::LogMessage(Log *log, const char *format, ...) {
void Module::LogMessageVerboseBacktrace(Log *log, const char *format, ...) {
if (log != nullptr) {
StreamString log_message;
- GetDescription(&log_message, lldb::eDescriptionLevelFull);
+ GetDescription(log_message.AsRawOstream(), lldb::eDescriptionLevelFull);
log_message.PutCString(": ");
va_list args;
va_start(args, format);
OpenPOWER on IntegriCloud