[PATCH] D60815: [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.
Eric Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 17 06:43:20 PDT 2019
ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: clangd/index/SymbolCollector.cpp:631
+
+bool SymbolCollector::isSelfContainedHeader(FileID FID) {
+ // The real computation (which will be memoized).
----------------
sammccall wrote:
> this has been moved to a member so it can use the cache and the (non-threadsafe) regex, and its logic has obviously been changed.
"self-contained header" doesn't sound accurate anymore. Maybe something like `isIncludable`?
================
Comment at: clangd/index/SymbolCollector.h:125
+ // they need to be included via an umbrella header. e.g. GTK matches this.
+ llvm::Regex DontIncludeMe = {
+ "^[ \t]*#[ \t]*if.*\n" // An #if, #ifndef etc directive, then
----------------
`DontIncludeMePattern` or `DontIncludeMeRegex`?
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60815/new/
https://reviews.llvm.org/D60815
More information about the cfe-commits
mailing list