[PATCH] D148176: [clang][modules] Avoid re-exporting PCH imports on every later module import

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 12 15:09:24 PDT 2023


benlangmuir created this revision.
benlangmuir added reviewers: akyrtzi, jansvoboda11, Bigcheese.
Herald added a project: All.
benlangmuir requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

We only want to make PCH imports visible once for the the TU, not repeatedly after every subsequent import. This causes some incorrect behaviour with submodule visibility, and causes us to get extra module dependencies in the scanner. So far I have only seen obviously incorrect behaviour when building with -fmodule-name to cause a submodule to be textually included when using the PCH, though the old behaviour seems wrong regardless.

rdar://107449644


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148176

Files:
  clang/include/clang/Serialization/ASTReader.h
  clang/lib/Serialization/ASTReader.cpp
  clang/test/ClangScanDeps/modules-pch-imports.c
  clang/test/Modules/submodule-visibility-pch.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148176.512982.patch
Type: text/x-patch
Size: 8317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230412/b1edc467/attachment.bin>


More information about the cfe-commits mailing list