This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Remove the overflow log.
ClosedPublic

Authored by hokein on Oct 18 2018, 7:45 AM.

Details

Summary

LLVM codebase has generated files (all are build/Target/XXX/*.inc) that
exceed the MaxLine & MaxColumn. Printing these log would be noisy.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Oct 18 2018, 7:45 AM

After looking at the examples, I'm reassured that we don't really care about tracking precise locations of those references :-)

I'd suggest adding the logging just to where the field is *read* in XRefs.cpp (check if it's max-value).
That would cover a bunch of the cases where an incorrect location is likely to be visible.

hokein updated this revision to Diff 170091.Oct 18 2018, 8:30 AM

Add log in XRefs.cpp.

sammccall accepted this revision.Oct 18 2018, 8:37 AM

Some nitty ideas about the log message, but whatever you think is best.

clangd/XRefs.cpp
43 ↗(On Diff #170091)

Log message could use more context. And I think it'd be really useful to print the whole location here.

bikeshed: you could add a method bool Position::hasOverflow(), and then write below

if (LSPLoc.range.start.hasOverflow() || LSPLoc.range.end.hasOverflow())
  log("Possible overflow in symbol location: {0}", LSPLoc);

Distinguishing between line/column overflow isn't important if you're printing the full range anyway.

This revision is now accepted and ready to land.Oct 18 2018, 8:37 AM
hokein updated this revision to Diff 170157.Oct 19 2018, 1:12 AM
hokein marked an inline comment as done.

Log the whole location when overflow happens.

hokein added inline comments.Oct 19 2018, 1:14 AM
clangd/XRefs.cpp
43 ↗(On Diff #170091)

This is neat.

hokein updated this revision to Diff 170159.Oct 19 2018, 1:22 AM

Minor cleanup.

This revision was automatically updated to reflect the committed changes.