[PATCH] D88822: [clangd] Describe non-handling of most IWYU pragmas. NFC

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 5 04:18:01 PDT 2020


sammccall created this revision.
sammccall added a reviewer: hokein.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman.
Herald added a project: clang.
sammccall requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88822

Files:
  clang-tools-extra/clangd/index/CanonicalIncludes.h


Index: clang-tools-extra/clangd/index/CanonicalIncludes.h
===================================================================
--- clang-tools-extra/clangd/index/CanonicalIncludes.h
+++ clang-tools-extra/clangd/index/CanonicalIncludes.h
@@ -71,6 +71,21 @@
 ///
 /// Currently it only supports IWYU private pragma:
 /// https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-private
+///
+/// We ignore other pragmas:
+/// - keep: this is common but irrelevant: we do not currently remove includes
+/// - export: this is common and potentially interesting, there are three cases:
+///    * Points to a public header (common): we can suppress include2 if you
+///      already have include1. Only marginally useful.
+///    * Points to a private header annotated with `private` (somewhat commmon):
+///      Not incrementally useful as we support private.
+///    * Points to a private header without pragmas (rare). This is a reversed
+///      private pragma, and is valuable but too rare to be worthwhile.
+/// - no_include: this is about as common as private, but only affects the
+///   current file, so the value is smaller. We could add support.
+/// - friend: this is less common than private, has implementation difficulties,
+///   and affects behavior in a limited scope.
+/// - associated: extremely rare
 std::unique_ptr<CommentHandler>
 collectIWYUHeaderMaps(CanonicalIncludes *Includes);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88822.296150.patch
Type: text/x-patch
Size: 1452 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201005/ef9ff992/attachment-0001.bin>


More information about the cfe-commits mailing list