[clang-tools-extra] 95262ee - [clangd] Describe non-handling of most IWYU pragmas. NFC

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 5 11:50:34 PDT 2020


Author: Sam McCall
Date: 2020-10-05T20:50:26+02:00
New Revision: 95262ee2be75daffd05e9a8a985ca2c8e34c9af7

URL: https://github.com/llvm/llvm-project/commit/95262ee2be75daffd05e9a8a985ca2c8e34c9af7
DIFF: https://github.com/llvm/llvm-project/commit/95262ee2be75daffd05e9a8a985ca2c8e34c9af7.diff

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

Differential Revision: https://reviews.llvm.org/D88822

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/index/CanonicalIncludes.h b/clang-tools-extra/clangd/index/CanonicalIncludes.h
index aabfabc75368..da7dc46db778 100644
--- a/clang-tools-extra/clangd/index/CanonicalIncludes.h
+++ b/clang-tools-extra/clangd/index/CanonicalIncludes.h
@@ -71,6 +71,21 @@ class CanonicalIncludes {
 ///
 /// 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 
diff iculties,
+///   and affects behavior in a limited scope.
+/// - associated: extremely rare
 std::unique_ptr<CommentHandler>
 collectIWYUHeaderMaps(CanonicalIncludes *Includes);
 


        


More information about the cfe-commits mailing list