This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Preserve line information while build PreamblePatch
ClosedPublic

Authored by kadircet on Apr 23 2020, 12:00 PM.

Diff Detail

Event Timeline

kadircet created this revision.Apr 23 2020, 12:00 PM
kadircet updated this revision to Diff 261744.May 4 2020, 12:14 AM
  • Rebase, add comments and introduce Inclusion equality
sammccall accepted this revision.May 5 2020, 1:38 AM
sammccall added inline comments.
clang-tools-extra/clangd/Preamble.cpp
321

what's the purpose of this? to avoid repeating the filename everywhere in the patch? maybe add a comment "// set default filename for subsequent #line directives"

327

I doubt we'd ever bother fixing this.

331

(this needs an update for the deleting-R patch)

clang-tools-extra/clangd/unittests/PreambleTests.cpp
139

nit: baseline is one word

142

I missed this last time, but this test seems unneccesarily confusing

  • can we just out the baseline and modified preambles instead of concatenating things together?
  • duplicated headers is worth testing but hardly the only case. Can we have a removed header as well, as one that was moved but not duplicated?
  • I think it'd be worth asserting the line numbers too
This revision is now accepted and ready to land.May 5 2020, 1:38 AM
kadircet updated this revision to Diff 262107.May 5 2020, 7:39 AM
kadircet marked 5 inline comments as done.
  • Rebase and address comments
sammccall accepted this revision.May 5 2020, 8:41 AM
kadircet updated this revision to Diff 262381.May 6 2020, 7:57 AM
  • Escape backslashes and quotes while generating line directive for filename
This revision was automatically updated to reflect the committed changes.