From aa89a9959b041538d8039f02aa34b65c7355b461 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 5 Nov 2024 11:52:07 +0100 Subject: tpp includes: Add hint for IWYU linting IWYU needs to be explicitly instructed how to handle included .tpp files in order to not falsely suggest their removal. Conversely, it also needs to know not to suggest including .tpp files instead of the corresponding .hpp files. --- src/buildtool/storage/large_object_cas.hpp | 2 +- src/buildtool/storage/large_object_cas.tpp | 2 ++ src/buildtool/storage/local_ac.hpp | 2 +- src/buildtool/storage/local_ac.tpp | 2 ++ src/buildtool/storage/local_cas.hpp | 2 +- src/buildtool/storage/local_cas.tpp | 2 ++ src/buildtool/storage/target_cache.hpp | 2 +- src/buildtool/storage/target_cache.tpp | 2 ++ 8 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/buildtool/storage/large_object_cas.hpp b/src/buildtool/storage/large_object_cas.hpp index 086875df..21b3127d 100644 --- a/src/buildtool/storage/large_object_cas.hpp +++ b/src/buildtool/storage/large_object_cas.hpp @@ -199,6 +199,6 @@ class LargeObjectCAS final { }; // NOLINTNEXTLINE(misc-header-include-cycle) -#include "src/buildtool/storage/large_object_cas.tpp" +#include "src/buildtool/storage/large_object_cas.tpp" // IWYU pragma: export #endif // INCLUDED_SRC_BUILDTOOL_STORAGE_LARGE_OBJECT_CAS_HPP diff --git a/src/buildtool/storage/large_object_cas.tpp b/src/buildtool/storage/large_object_cas.tpp index bb7794bb..5b8daa32 100644 --- a/src/buildtool/storage/large_object_cas.tpp +++ b/src/buildtool/storage/large_object_cas.tpp @@ -15,6 +15,8 @@ #ifndef INCLUDED_SRC_BUILDTOOL_STORAGE_LARGE_OBJECT_CAS_TPP #define INCLUDED_SRC_BUILDTOOL_STORAGE_LARGE_OBJECT_CAS_TPP +// IWYU pragma: private, include "src/buildtool/storage/large_object_cas.hpp" + #include #include #include diff --git a/src/buildtool/storage/local_ac.hpp b/src/buildtool/storage/local_ac.hpp index 7edb5bf3..60354a2b 100644 --- a/src/buildtool/storage/local_ac.hpp +++ b/src/buildtool/storage/local_ac.hpp @@ -133,7 +133,7 @@ class LocalAC { #ifndef BOOTSTRAP_BUILD_TOOL // NOLINTNEXTLINE(misc-header-include-cycle) -#include "src/buildtool/storage/local_ac.tpp" +#include "src/buildtool/storage/local_ac.tpp" // IWYU pragma: export #endif #endif // INCLUDED_SRC_BUILDTOOL_STORAGE_LOCAL_AC_HPP diff --git a/src/buildtool/storage/local_ac.tpp b/src/buildtool/storage/local_ac.tpp index d5cbbe5e..05939746 100644 --- a/src/buildtool/storage/local_ac.tpp +++ b/src/buildtool/storage/local_ac.tpp @@ -15,6 +15,8 @@ #ifndef INCLUDED_SRC_BUILDTOOL_STORAGE_LOCAL_AC_TPP #define INCLUDED_SRC_BUILDTOOL_STORAGE_LOCAL_AC_TPP +// IWYU pragma: private, include "src/buildtool/storage/local_ac.hpp" + #include //std::ignore #include // std::move diff --git a/src/buildtool/storage/local_cas.hpp b/src/buildtool/storage/local_cas.hpp index 5f3a9db6..9a9f040a 100644 --- a/src/buildtool/storage/local_cas.hpp +++ b/src/buildtool/storage/local_cas.hpp @@ -353,7 +353,7 @@ class LocalCAS { #ifndef BOOTSTRAP_BUILD_TOOL // NOLINTNEXTLINE(misc-header-include-cycle) -#include "src/buildtool/storage/local_cas.tpp" +#include "src/buildtool/storage/local_cas.tpp" // IWYU pragma: export #else template auto LocalCAS::CheckTreeInvariant( diff --git a/src/buildtool/storage/local_cas.tpp b/src/buildtool/storage/local_cas.tpp index 29bf28f5..ebec5a00 100644 --- a/src/buildtool/storage/local_cas.tpp +++ b/src/buildtool/storage/local_cas.tpp @@ -15,6 +15,8 @@ #ifndef INCLUDED_SRC_BUILDTOOL_STORAGE_LOCAL_CAS_TPP #define INCLUDED_SRC_BUILDTOOL_STORAGE_LOCAL_CAS_TPP +// IWYU pragma: private, include "src/buildtool/storage/local_cas.hpp" + #include #include // std::move diff --git a/src/buildtool/storage/target_cache.hpp b/src/buildtool/storage/target_cache.hpp index a45d3999..9dc30d11 100644 --- a/src/buildtool/storage/target_cache.hpp +++ b/src/buildtool/storage/target_cache.hpp @@ -160,6 +160,6 @@ using ActiveTargetCache = TargetCache; #endif // BOOTSTRAP_BUILD_TOOL // NOLINTNEXTLINE(misc-header-include-cycle) -#include "src/buildtool/storage/target_cache.tpp" +#include "src/buildtool/storage/target_cache.tpp" // IWYU pragma: export #endif // INCLUDED_SRC_BUILDTOOL_STORAGE_TARGET_CACHE_HPP diff --git a/src/buildtool/storage/target_cache.tpp b/src/buildtool/storage/target_cache.tpp index c31fa1cc..6ce20300 100644 --- a/src/buildtool/storage/target_cache.tpp +++ b/src/buildtool/storage/target_cache.tpp @@ -15,6 +15,8 @@ #ifndef INCLUDED_SRC_BUILDTOOL_STORAGE_TARGET_CACHE_TPP #define INCLUDED_SRC_BUILDTOOL_STORAGE_TARGET_CACHE_TPP +// IWYU pragma: private, include "src/buildtool/storage/target_cache.hpp" + #include #include //std::ignore -- cgit v1.2.3