summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-03-25 01:57:14 +0000
committerJim Ingham <jingham@apple.com>2016-03-25 01:57:14 +0000
commita1e541bf9fe0253541e6460ed8866f1a4ce0c9dd (patch)
treecabc44445df6df157522ea33af070393120e295e /lldb/source/Expression
parent68f56243563417be95e7ef6936f7b7fc9dedf580 (diff)
downloadbcm5719-llvm-a1e541bf9fe0253541e6460ed8866f1a4ce0c9dd.tar.gz
bcm5719-llvm-a1e541bf9fe0253541e6460ed8866f1a4ce0c9dd.zip
Use Clang's FixItHints to correct expressions with "trivial" mistakes (e.g. "." for "->".)
This feature is controlled by an expression command option, a target property and the SBExpressionOptions setting. FixIt's are only applied to UserExpressions, not UtilityFunctions, those you have to get right when you make them. This is just a first stage. At present the fixits are applied silently. The next step is to tell the user about the applied fixit. <rdar://problem/25351938> llvm-svn: 264379
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/DiagnosticManager.cpp6
-rw-r--r--lldb/source/Expression/UserExpression.cpp1
2 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Expression/DiagnosticManager.cpp b/lldb/source/Expression/DiagnosticManager.cpp
index 8b788680936..e0a5c492068 100644
--- a/lldb/source/Expression/DiagnosticManager.cpp
+++ b/lldb/source/Expression/DiagnosticManager.cpp
@@ -52,10 +52,10 @@ DiagnosticManager::GetString(char separator)
{
std::string ret;
- for (const Diagnostic &diagnostic : Diagnostics())
+ for (const Diagnostic *diagnostic : Diagnostics())
{
- ret.append(StringForSeverity(diagnostic.severity));
- ret.append(diagnostic.message);
+ ret.append(StringForSeverity(diagnostic->GetSeverity()));
+ ret.append(diagnostic->GetMessage());
ret.push_back(separator);
}
diff --git a/lldb/source/Expression/UserExpression.cpp b/lldb/source/Expression/UserExpression.cpp
index 6f637b1db92..2d1336b3ef5 100644
--- a/lldb/source/Expression/UserExpression.cpp
+++ b/lldb/source/Expression/UserExpression.cpp
@@ -253,6 +253,7 @@ UserExpression::Evaluate (ExecutionContext &exe_ctx,
}
DiagnosticManager diagnostic_manager;
+ diagnostic_manager.SetAutoApplyFixIts(options.GetAutoApplyFixIts());
if (!user_expression_sp->Parse(diagnostic_manager, exe_ctx, execution_policy, keep_expression_in_memory,
generate_debug_info))
OpenPOWER on IntegriCloud