[PATCH] D137319: [include-cleaner] Add export IWYU pragma support.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 10 04:56:04 PST 2022


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

thanks for bearing with me, LG!



================
Comment at: clang-tools-extra/include-cleaner/lib/Record.cpp:72
 
+  void checkForExport(FileID FileSeenHash, int HashLine,
+                      const FileEntry *IncludedHeader) {
----------------
`FileSeenHash` feels a little bit confusing (sounds like hash of an entity), why not directly call it as the `IncludingFile`? (similarly instead of `HashLine`, `IncludeLine` or `DirectiveLine` ?)


================
Comment at: clang-tools-extra/include-cleaner/lib/Record.cpp:84
+        Out->IWYUExportBy[IncludedHeader->getUniqueID()].push_back(
+            save(SM.getFileEntryForID(Top.SeenAtFile)->tryGetRealPathName()));
+      // main-file #include with export pragma should never be removed.
----------------
i guess we should just use `Top.FullPath` here instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137319



More information about the cfe-commits mailing list