This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix redefinition of module in the same module.modulemap file
ClosedPublic

Authored by DmitryPolukhin on Oct 21 2020, 7:58 AM.

Details

Summary

In memory VFS cannot handle aceesssing the same file with different paths.
This diff just stops using VFS for modulemap files.

Fixes PR47839

Diff Detail

Event Timeline

DmitryPolukhin created this revision.Oct 21 2020, 7:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2020, 7:58 AM
DmitryPolukhin requested review of this revision.Oct 21 2020, 7:58 AM

And one more time linting

alexfh accepted this revision.Oct 22 2020, 4:11 AM

Looks good!

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
27

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?

This revision is now accepted and ready to land.Oct 22 2020, 4:11 AM

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

Added all module map file names

DmitryPolukhin marked an inline comment as done.Oct 22 2020, 7:56 AM

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.

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
27

I think it is relevant for these files too, added them all.

alexfh accepted this revision.Oct 22 2020, 3:06 PM

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.

I see. Let's keep it as is then.

Looks good!