[PATCH] D157610: [include-cleaner][clangd][clang-tidy] Ignore resource dir during include-cleaner analysis.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 04:09:52 PDT 2023


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

thanks!



================
Comment at: clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp:587
+  TU.ExtraArgs.push_back(testPath("resources"));
+  TU.AdditionalFiles["resources/include/amintrin.h"] = "";
+  TU.AdditionalFiles["resources/include/imintrin.h"] = guard(R"cpp(
----------------
nit: also wrap contents in `guard()` here to make sure we're not testing multiple things here (i.e. behavior for non-self-contained headers)


================
Comment at: clang-tools-extra/include-cleaner/lib/Analysis.cpp:100
                  Satisfied = true;
+                 continue;
+               }
----------------
now we're not going to put matching includes into the `Used` set. i know we're going to filter them put from the final output in the next loop, but still better to keep normal track of `Used` i believe


================
Comment at: clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp:286
+  )cpp";
+  Inputs.ExtraFiles["resources/include/amintrin.h"] = "";
+  Inputs.ExtraFiles["resources/include/emintrin.h"] = guard(R"cpp(
----------------
again lets make this self-contained


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157610



More information about the cfe-commits mailing list