This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add helper for collecting #include directives in file.
ClosedPublic

Authored by ioeric on May 9 2018, 11:58 PM.

Diff Detail

Event Timeline

ioeric created this revision.May 9 2018, 11:58 PM
ioeric edited the summary of this revision. (Show Details)May 9 2018, 11:59 PM
ioeric updated this revision to Diff 146074.May 10 2018, 12:01 AM
  • Rebase on origin/master
sammccall accepted this revision.May 14 2018, 4:43 AM
sammccall added inline comments.
clangd/ClangdUnit.h
53–55

this might be a good place to explain *why* we collect these - processes like code completion will need #include information later, and their compile action skips the preamble range

clangd/Headers.h
47

as Ilya suggested, I like the idea of passing a callback(Inclusion) here rather than a vector reference. It's much more obvious at the callsite what's going to happen (and doesn't force the use of the vector).
Also lifetime issues are still a little complicated, but easier to debug I think.

This revision is now accepted and ready to land.May 14 2018, 4:43 AM
ioeric updated this revision to Diff 146581.May 14 2018, 5:04 AM
ioeric marked an inline comment as done.
  • Merged with origin/master
  • Addressed review comments.
This revision was automatically updated to reflect the committed changes.