kadircet updated this revision to Diff 258915.
kadircet marked 2 inline comments as done.
kadircet added a comment.
- Make scanPreambleIncludes return an Expected>
- Bail out in case of errors, document the rational.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://revi
kadircet marked an inline comment as done.
kadircet added inline comments.
Comment at: clang-tools-extra/clangd/Preamble.cpp:281
+ // We are only interested in newly added includes.
+ llvm::StringSet<> ExistingIncludes;
+ for (const auto &Inc : Preamble.LexedIncludes)
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
Keep missing the "ship it" button...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77392/new/
https://reviews.llvm.org/D77392
_
sammccall marked an inline comment as done.
sammccall added a comment.
Great stuff!
Comment at: clang-tools-extra/clangd/Preamble.cpp:281
+ // We are only interested in newly added includes.
+ llvm::StringSet<> ExistingIncludes;
+ for (const auto &Inc : Preamble.LexedInclude
kadircet updated this revision to Diff 258833.
kadircet marked 2 inline comments as done.
kadircet added a comment.
- Address comments
- Don't store LexedInclude in PreambleData, expose the contents in
PrecompiledPreamble instead.
- Introduce DenseMapInfo for PPKeywordKind
Repository:
rG LLVM
kadircet marked 15 inline comments as done.
kadircet added inline comments.
Comment at: clang-tools-extra/clangd/Preamble.cpp:278
+ // This shouldn't coincide with any real file name.
+ PP.PatchFileName = llvm::formatv("{0}_preamble_patch.h", FileName);
+
sammc
sammccall added a comment.
This looks pretty good! Haven't reviewed the tests or removal of consistent
preamble support yet. (Mostly note-to-self)
Comment at: clang-tools-extra/clangd/Preamble.cpp:115
+do {
+ PP.Lex(Tok);
+} while (Tok.isNot(tok::eof) &&
-
kadircet added a comment.
This is ready for another round. To summarize the current state:
- `PreamblePatch` can be create from a `ParseInput` and a `PreambleData`,
- It will preprocessor preamble section of current file contents using a
dummy FS to reduce cost of stat/realpaths
- It won't p
kadircet updated this revision to Diff 258064.
kadircet added a comment.
- Use preprocessor instead of raw lexer
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77392/new/
https://reviews.llvm.org/D77392
Files:
clang-tools-extra/clangd/ClangdServe
kadircet marked 3 inline comments as done.
kadircet added inline comments.
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1076
+ if (PatchAdditionalIncludes) {
+for (const auto &Inc : newIncludes(
+ Input.Preamble.LexedIncludes,
sammccall
kadircet updated this revision to Diff 256359.
kadircet added a comment.
Herald added a subscriber: mgorny.
- Encapsulate logic into `PreamblePatch`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77392/new/
https://reviews.llvm.org/D77392
Files:
sammccall added a comment.
This is the perfect feature to start with (doesn't actually need any location
transforms, lets us drop TUScheduler features), so well done for finding that.
That said, high-level comments mostly about preamble patching in general rather
than this particular case.
=
12 matches
Mail list logo