aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
diff options
context:
space:
mode:
authorKadir Cetinkaya <kadircet@google.com>2023-05-23 16:28:22 +0200
committerKadir Cetinkaya <kadircet@google.com>2023-08-02 12:47:53 +0200
commit778a5e9bc6335061d5c6c27795bb8c4f768af7f3 (patch)
tree42705804b407cf016532e010817ffcbcf9912083 /clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
parentacdc503d6c51417c0171373ad65f42fc8fcbe5a1 (diff)
downloadllvm-778a5e9bc6335061d5c6c27795bb8c4f768af7f3.zip
llvm-778a5e9bc6335061d5c6c27795bb8c4f768af7f3.tar.gz
llvm-778a5e9bc6335061d5c6c27795bb8c4f768af7f3.tar.bz2
[include-cleaner] Introduce support for always_keep pragma
Differential Revision: https://reviews.llvm.org/D156122
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp b/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
index f6292d7..0798890 100644
--- a/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
@@ -143,7 +143,7 @@ void IncludeCleanerCheck::check(const MatchFinder::MatchResult &Result) {
RecordedPreprocessor.Includes.all()) {
if (Used.contains(&I) || !I.Resolved)
continue;
- if (RecordedPI.shouldKeep(I.Line))
+ if (RecordedPI.shouldKeep(I.Line) || RecordedPI.shouldKeep(*I.Resolved))
continue;
// Check if main file is the public interface for a private header. If so
// we shouldn't diagnose it as unused.