Make DiagnosticsManager functions take StringRefs.
llvm-svn: 286730
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index 1df6246..d91da5f 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -624,8 +624,8 @@
if (m_pp_callbacks && m_pp_callbacks->hasErrors()) {
num_errors++;
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "while importing modules:");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "while importing modules:");
diagnostic_manager.AppendMessageToDiagnostic(
m_pp_callbacks->getErrorString().c_str());
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
index 87d7738..b1428bb 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
@@ -203,8 +203,8 @@
num_errors = m_parser->Parse(diagnostic_manager);
} else {
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "no process - unable to inject function");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "no process - unable to inject function");
num_errors = 1;
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 59dd137..5abad71 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -325,21 +325,21 @@
lldb::eLanguageTypeC)) {
m_result_delegate.RegisterPersistentState(persistent_state);
} else {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"couldn't start parsing (no persistent data)");
return false;
}
} else {
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "error: couldn't start parsing (no target)");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "error: couldn't start parsing (no target)");
return false;
}
ScanContext(exe_ctx, err);
if (!err.Success()) {
- diagnostic_manager.PutCString(eDiagnosticSeverityWarning, err.AsCString());
+ diagnostic_manager.PutString(eDiagnosticSeverityWarning, err.AsCString());
}
////////////////////////////////////
@@ -400,8 +400,8 @@
if (!source_code->GetText(m_transformed_text, lang_type, m_in_static_method,
exe_ctx)) {
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "couldn't construct expression body");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "couldn't construct expression body");
return false;
}
}
@@ -416,7 +416,7 @@
Target *target = exe_ctx.GetTargetPtr();
if (!target) {
- diagnostic_manager.PutCString(eDiagnosticSeverityError, "invalid target");
+ diagnostic_manager.PutString(eDiagnosticSeverityError, "invalid target");
return false;
}
@@ -443,7 +443,7 @@
OnExit on_exit([this]() { ResetDeclMap(); });
if (!DeclMap()->WillParse(exe_ctx, m_materializer_ap.get())) {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"current process state is unsuitable for expression parsing");
@@ -508,10 +508,10 @@
if (!jit_error.Success()) {
const char *error_cstr = jit_error.AsCString();
if (error_cstr && error_cstr[0])
- diagnostic_manager.PutCString(eDiagnosticSeverityError, error_cstr);
+ diagnostic_manager.PutString(eDiagnosticSeverityError, error_cstr);
else
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "expression can't be interpreted or run");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "expression can't be interpreted or run");
return false;
}
}
@@ -527,8 +527,8 @@
"couldn't run static initializers: %s\n",
error_cstr);
else
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "couldn't run static initializers\n");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "couldn't run static initializers\n");
return false;
}
}
@@ -597,7 +597,7 @@
} else if (m_in_objectivec_method) {
object_name.SetCString("self");
} else {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"need object pointer but don't know the language");
return false;
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
index d3af620..5a86994 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
@@ -1,5 +1,4 @@
-//===-- ClangUserExpression.cpp -------------------------------------*- C++
-//-*-===//
+//===-- ClangUserExpression.cpp ----------------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -63,8 +62,8 @@
bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager,
ExecutionContext &exe_ctx) {
if (m_jit_start_addr != LLDB_INVALID_ADDRESS) {
- diagnostic_manager.PutCString(eDiagnosticSeverityWarning,
- "already installed");
+ diagnostic_manager.PutString(eDiagnosticSeverityWarning,
+ "already installed");
return false;
}
@@ -75,14 +74,14 @@
Target *target = exe_ctx.GetTargetPtr();
if (!target) {
- diagnostic_manager.PutCString(eDiagnosticSeverityError, "invalid target");
+ diagnostic_manager.PutString(eDiagnosticSeverityError, "invalid target");
return false;
}
Process *process = exe_ctx.GetProcessPtr();
if (!process) {
- diagnostic_manager.PutCString(eDiagnosticSeverityError, "invalid process");
+ diagnostic_manager.PutString(eDiagnosticSeverityError, "invalid process");
return false;
}
@@ -95,7 +94,7 @@
ResetDeclMap(exe_ctx, keep_result_in_memory);
if (!DeclMap()->WillParse(exe_ctx, NULL)) {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"current process state is unsuitable for expression parsing");
return false;
@@ -159,8 +158,8 @@
if (error_cstr && error_cstr[0]) {
diagnostic_manager.Printf(eDiagnosticSeverityError, "%s", error_cstr);
} else {
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "expression can't be interpreted or run");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "expression can't be interpreted or run");
}
return false;
}
diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
index ff20be1..30cc4aa 100644
--- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
@@ -216,7 +216,7 @@
return true;
const char *error_cstr = m_interpreter->error().AsCString();
if (error_cstr && error_cstr[0])
- diagnostic_manager.PutCString(eDiagnosticSeverityError, error_cstr);
+ diagnostic_manager.PutString(eDiagnosticSeverityError, error_cstr);
else
diagnostic_manager.Printf(eDiagnosticSeverityError,
"expression can't be interpreted or run");
@@ -245,8 +245,8 @@
log->Printf("== [GoUserExpression::Evaluate] Expression may not run, "
"but is not constant ==");
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "expression needed to run but couldn't");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "expression needed to run but couldn't");
return execution_results;
}
@@ -260,10 +260,10 @@
if (!result_val_sp) {
const char *error_cstr = err.AsCString();
if (error_cstr && error_cstr[0])
- diagnostic_manager.PutCString(eDiagnosticSeverityError, error_cstr);
+ diagnostic_manager.PutString(eDiagnosticSeverityError, error_cstr);
else
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "expression can't be interpreted or run");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "expression can't be interpreted or run");
return lldb::eExpressionDiscarded;
}
result.reset(new ExpressionVariable(ExpressionVariable::eKindGo));