[clang][modules][deps] Avoid checks for relocated modules
authorJan Svoboda <jan_svoboda@apple.com>
Thu, 6 Jul 2023 16:30:06 +0000 (18:30 +0200)
committerJan Svoboda <jan_svoboda@apple.com>
Mon, 17 Jul 2023 20:50:24 +0000 (13:50 -0700)
commit227f71995804fa5df3f917ae3a7b1499cd24726c
treeba06a52e7e2002963fcee178b08630ce45164977
parentabcf7ce45794839a473a236d55d163016cde5ba6
[clang][modules][deps] Avoid checks for relocated modules

Currently, `ASTReader` performs some checks to diagnose relocated modules. This can add quite a bit of overhead to the scanner: it requires looking up, parsing and resolving module maps for all transitively loaded module files (and all the module maps encountered in the search paths on the way). Most of those checks are not really useful in the scanner anyway, since it uses strict context hash and immutable filesystem, which prevent those scenarios in the first place.

This can speed up scanning by up to 30%.

Depends on D150292.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D150320
clang/include/clang/Lex/PreprocessorOptions.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
clang/test/ClangScanDeps/header-search-pruning-transitive.c