llvm-capstone/lldb/source/Expression
Raphael Isemann 203a8adb65 [lldb] Add option to retry Fix-Its multiple times to failed expressions
Summary:
Usually when Clang emits an error Fix-It it does two things. It emits the diagnostic and then it fixes the
currently generated AST to reflect the applied Fix-It. While emitting the diagnostic is easy to implement,
fixing the currently generated AST is often tricky. That causes that some Fix-Its just keep the AST as-is or
abort the parsing process entirely. Once the parser stopped, any Fix-Its for the rest of the expression are
not detected and when the user manually applies the Fix-It, the next expression will just produce a new
Fix-It.

This is often occurring with quickly made Fix-Its that are just used to bridge temporary API changes
and that often are not worth implementing a proper API fixup in addition to the diagnostic. To still
give some kind of reasonable user-experience for users that have these Fix-Its and rely on them to
fix their expressions, this patch adds the ability to retry parsing with applied Fix-Its multiple time to
give the normal Fix-It experience where things Clang knows how to fix are not causing actual expression
error (at least when automatically applying Fix-Its is activated).

The way this is implemented is just by having another setting in the expression options that specify how
often we should try applying Fix-Its and then reparse the expression. The default setting is still 1 for everyone
so this should not affect the speed in which we fail to parse expressions.

Reviewers: jingham, JDevlieghere, friss, shafik

Reviewed By: shafik

Subscribers: shafik, abidh

Differential Revision: https://reviews.llvm.org/D77214
2020-04-06 11:25:36 +02:00
..
CMakeLists.txt [Expression] Move IRDynamicChecks to ClangExpressionParser 2019-07-12 00:58:02 +00:00
DiagnosticManager.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DWARFExpression.cpp [lldb/DWARF] Fix evaluator crash when accessing empty stack. 2020-03-31 17:44:57 +02:00
Expression.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ExpressionVariable.cpp Internal expressions shouldn't increment the result variable numbering. 2020-03-23 13:30:37 -07:00
FunctionCaller.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
IRExecutionUnit.cpp [lldb][NFC] Make all CompilerDeclContext parameters references instead of pointers 2020-02-18 08:58:36 +01:00
IRInterpreter.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00
IRMemoryMap.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LLVMUserExpression.cpp [lldb][NFCI] Remove UserExpression::GetJITModule 2020-01-30 23:20:19 -08:00
Materializer.cpp Internal expressions shouldn't increment the result variable numbering. 2020-03-23 13:30:37 -07:00
REPL.cpp [lldb][NFC] Remove several inefficient ConstString -> const char * -> StringRef conversions 2020-02-11 09:14:41 +01:00
UserExpression.cpp [lldb] Add option to retry Fix-Its multiple times to failed expressions 2020-04-06 11:25:36 +02:00
UtilityFunction.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00