By now LLDB can import the 'std' C++ module to improve expression evaluation, but there are still a
few problems to solve before we can do this by default. One is that importing the C++ module is slightly slower
than normal expression evaluation (mostly because the disk access and loading the initial lookup data is quite
slow in comparison to the barebone Clang setup the rest of the LLDB expression evaluator is usually doing).
Another problem is that some complicated types in the standard library aren't fully supported yet by the ASTImporter,
so we end up types that fail to import (which usually appears to the user as if the type is empty or there is just
no result variable).
To still allow people to adopt this mode in their daily debugging, this patch adds a setting that allows LLDB to
automatically retry failed expression with a loaded C++ module. All success expressions will behave exactly as
they would do before this patch. Failed expressions get a another parse attempt if we find a usable C++ module
in the current execution context. This way we shouldn't have any performance/parsing regressions in normal debugging
workflows, while the debugging workflows involving STL containers benefit from the C++ module type info.
This setting is off by default for now with the intention to enable it by default on macOS soon-ish.
The implementation is mostly just extracting the existing parse logic into its own function and then calling the parse
function again if the first evaluation failed and we have a C++ module to retry the parsing with.
nit: \see