summaryrefslogtreecommitdiff
path: root/include/lldb/Expression/ExpressionParser.h
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
commit9301928b884fe2d18cf15d0532ccda88e8477bde (patch)
tree4cc03cf7748bdc30559ef7637bd6feeb3c5a1bc2 /include/lldb/Expression/ExpressionParser.h
parent4420c3bd5541adfa6ab35aca4d23c3fdccb0ece0 (diff)
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> git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@264379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/lldb/Expression/ExpressionParser.h')
-rw-r--r--include/lldb/Expression/ExpressionParser.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/lldb/Expression/ExpressionParser.h b/include/lldb/Expression/ExpressionParser.h
index d5dc03d2e..323e515e3 100644
--- a/include/lldb/Expression/ExpressionParser.h
+++ b/include/lldb/Expression/ExpressionParser.h
@@ -58,7 +58,7 @@ public:
/// wrap the expression in anything at all.
///
/// @param[in] diagnostic_manager
- /// The stream to print errors to.
+ /// The diagnostic manager in which to store the errors and warnings.
///
/// @return
/// The number of errors encountered during parsing. 0 means
@@ -66,6 +66,23 @@ public:
//------------------------------------------------------------------
virtual unsigned
Parse(DiagnosticManager &diagnostic_manager) = 0;
+
+ //------------------------------------------------------------------
+ /// Try to use the FixIts in the diagnostic_manager to rewrite the
+ /// expression. If successful, the rewritten expression is stored
+ /// in the diagnostic_manager, get it out with GetFixedExpression.
+ ///
+ /// @param[in] diagnostic_manager
+ /// The diagnostic manager containing fixit's to apply.
+ ///
+ /// @return
+ /// \b true if the rewrite was successful, \b false otherwise.
+ //------------------------------------------------------------------
+ virtual bool
+ RewriteExpression(DiagnosticManager &diagnostic_manager)
+ {
+ return false;
+ }
//------------------------------------------------------------------
/// Ready an already-parsed expression for execution, possibly