[PATCH] D136071: [include-cleaner] Add PragmaIncludes which handles include-mapping pragmas.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 04:05:06 PDT 2022


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks, LG from my side as well, just some small tweaks for tests.



================
Comment at: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp:124
+  TestAST Processed = build();
+  EXPECT_FALSE(PI.shouldKeep(1));
+  EXPECT_TRUE(PI.shouldKeep(2));
----------------
it'd be better to test with an include-directive that doesn't have a keep pragma attached


================
Comment at: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp:135
+  Inputs.ExtraFiles["private.h"] = R"cpp(
+    // IWYU pragma: private, include "public.h"
+    class Private {};
----------------
it'd be better to map this to a header that isn't part of the TU, to make sure we don't rely on a file entry being around for a particular spelling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136071/new/

https://reviews.llvm.org/D136071



More information about the cfe-commits mailing list