aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2024-05-01 09:38:16 -0700
committerGitHub <noreply@github.com>2024-05-01 09:38:16 -0700
commit477c705cb0d7cc857fad8184faac523f8ef72c84 (patch)
treeb9828738e5a894ab94ee45f9b6f3d6edadfd36e0 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent754072e9a5c0785560953e237229d0fbdd504d04 (diff)
downloadllvm-477c705cb0d7cc857fad8184faac523f8ef72c84.zip
llvm-477c705cb0d7cc857fad8184faac523f8ef72c84.tar.gz
llvm-477c705cb0d7cc857fad8184faac523f8ef72c84.tar.bz2
[clang][modules] Allow including module maps to be non-affecting (#89992)
The dependency scanner only puts top-level affecting module map files on the command line for explicitly building a module. This is done because any affecting child module map files should be referenced by the top-level one, meaning listing them explicitly does not have any meaning and only makes the command lines longer. However, a problem arises whenever the definition of an affecting module lives in a module map that is not top-level. Considering the rules explained above, such module map file would not make it to the command line. That's why 83973cf157f7850eb133a4bbfa0f8b7958bad215 started marking the parents of an affecting module map file as affecting too. This way, the top-level file does make it into the command line. This can be problematic, though. On macOS, for example, the Darwin module lives in "/usr/include/Darwin.modulemap" one of many module map files included by "/usr/include/module.modulemap". Reporting the parent on the command line forces explicit builds to parse all the other module map files included by it, which is not necessary and can get expensive in terms of file system traffic. This patch solves that performance issue by stopping marking parent module map files as affecting, and marking module map files as top-level whenever they are top-level among the set of affecting files, not among the set of all known files. This means that the top-level "/usr/include/module.modulemap" is now not marked as affecting and "/usr/include/Darwin.modulemap" is.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions