[PATCH] D89886: [clang-tidy] Fix redefinition of module in the same module.modulemap file

Dmitry Polukhin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 07:56:42 PDT 2020


DmitryPolukhin marked an inline comment as done.
DmitryPolukhin added a comment.

In D89886#2346851 <https://reviews.llvm.org/D89886#2346851>, @alexfh wrote:

> Ah, btw, any chance of adding a test for this?

Oh, I was not able to create small reproducer that without including large Apple Frameworks with modules :( My hypothesis that it is side effect of module cache that triggers module load before it is referenced from sources. I tested it on reproducer from PR47839 + my real internal example.



================
Comment at: clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp:27
+    // detection.
+    if (!File->getName().endswith("module.modulemap"))
+      FilesToRecord.insert(File);
----------------
alexfh wrote:
> Looking at the relevant code I find special file names like "module.map", "module_private.map", "module.private.modulemap". Is this problem relevant for any of those?
I think it is relevant for these files too, added them all.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89886



More information about the cfe-commits mailing list