This is an archive of the discontinued LLVM Phabricator instance.

Streamline expression parser error messages
ClosedPublic

Authored by aprantl on Jun 9 2023, 3:36 PM.

Details

Summary

Currently the expression parser prints a mostly useless generic error before printing the compiler error:

(lldb) p 1+x)
error: expression failed to parse:
error: <user expression 18>:1:3: use of undeclared identifier 'x'
1+x)
  ^

This is distracting and as far as I can tell only exists to work around the fact that the first "error: " is unconditionally injected by CommandReturnObject. The solution is not very elegant, but the result looks much better.

(Partially addresses rdar://110492710)

Diff Detail

Event Timeline

aprantl created this revision.Jun 9 2023, 3:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2023, 3:36 PM
aprantl requested review of this revision.Jun 9 2023, 3:36 PM

pinging after the weekend.

This revision is now accepted and ready to land.Jun 12 2023, 9:56 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2023, 10:30 AM
kastiglione added inline comments.Jun 12 2023, 10:32 AM
lldb/source/Interpreter/CommandReturnObject.cpp
104

nice