While debugging another bug I found out that we currently don't set any limit for the
number of diagnostics Clang emits. If a user does something that generates a lot of
errors (like including some long header file from within the expression function), then
we currently spam the LLDB output with potentially thousands of Clang error diagnostics.
Clang sets a default limit of 20 errors, but given that LLDB is often used interactively
for small expressions I would say a limit of 5 is enough. The limit is implemented as a
setting, so if a user cares about seeing having a million errors printed to their terminal
then they can just increase the settings value.
Nit: Could you rename this to GetExpressionErrorLimit to stay consistent with the previous method ?