summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Clang
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-12 19:12:56 +0000
committerZachary Turner <zturner@google.com>2016-11-12 19:12:56 +0000
commite2411fabdaf01d883d77cf3f8456367a9dc685ff (patch)
tree118b9b3531a39255e9174d88899514d599524a53 /lldb/source/Plugins/ExpressionParser/Clang
parent43400b4c069bf882c6c1e881d65d6a4c865d4dc0 (diff)
downloadbcm5719-llvm-e2411fabdaf01d883d77cf3f8456367a9dc685ff.tar.gz
bcm5719-llvm-e2411fabdaf01d883d77cf3f8456367a9dc685ff.zip
Make DiagnosticsManager functions take StringRefs.
llvm-svn: 286730
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp4
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp4
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp28
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp17
4 files changed, 26 insertions, 27 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index 1df6246d491..d91da5f40d9 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -624,8 +624,8 @@ unsigned ClangExpressionParser::Parse(DiagnosticManager &diagnostic_manager) {
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 87d77386782..b1428bb3005 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
@@ -203,8 +203,8 @@ ClangFunctionCaller::CompileFunction(lldb::ThreadSP thread_to_use_sp,
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 59dd137edd3..5abad71b84a 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -325,21 +325,21 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
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 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
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 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
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 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
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 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
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 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
"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 @@ bool ClangUserExpression::AddArguments(ExecutionContext &exe_ctx,
} 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 d3af620145b..5a86994037b 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 @@ ClangUtilityFunction::~ClangUtilityFunction() {}
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 @@ bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager,
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 @@ bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager,
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 @@ bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager,
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;
}
OpenPOWER on IntegriCloud