This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules][deps] Avoid checks for relocated modules
ClosedPublic

Authored by jansvoboda11 on May 10 2023, 3:31 PM.

Details

Summary

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.

Diff Detail

Event Timeline

jansvoboda11 created this revision.May 10 2023, 3:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 3:31 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.May 10 2023, 3:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 3:31 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benlangmuir accepted this revision.May 10 2023, 3:51 PM

With my naming comment addressed, LGTM

clang/include/clang/Lex/PreprocessorOptions.h
73

Suggestion: CheckRelocatableModules. The current name sounds like a compiler feature rather than controlling diagnostics.

This revision is now accepted and ready to land.May 10 2023, 3:51 PM
jansvoboda11 retitled this revision from [clang][deps] Avoid relocatable modules checks to [clang][modules][deps] Avoid checks for relocated modules.Jul 11 2023, 8:32 AM

Rename the new preprocessor option, fix failing test

This revision was landed with ongoing or failed builds.Jul 17 2023, 1:51 PM
This revision was automatically updated to reflect the committed changes.