[stable/20240723][clang][modules] Fix local submodule visibility of macros from transitive import#10086
Merged
akyrtzi merged 1 commit intoswiftlang:stable/20240723from Feb 22, 2025
Conversation
benlangmuir
commented
Feb 21, 2025
- Explanation: When using local submodule visibility (on by default for c++, off for c/objc), macros from some transitive imports could fail to be made visible depending on whether the submodule was written in the modulemap file or discovered from an umbrella directory. When using caching this applies to all submodules.
- Scope: Affects modules in C++ modes, or if local submodule visibility is manually enabled in other language modes. Can affect non-caching builds depending on how the modulemap is written, but will primarily impact caching builds in practice.
- Issue/Radar: rdar://136524433
- Original PR: [clang][modules] Fix local submodule visibility of macros from transitive import llvm/llvm-project#122955
- Risk: Low. Any submodule we stop marking visible immediately after this change will be made visible when it is actually imported, so this should only fix broken cases not change working ones.
- Testing: Added regression test.
- Reviewer: @Bigcheese
…tive import (llvm#122955) When we mark a module visible, we normally mark all of its non-explicit submodules and other exports as visible. However, when we first enter a submodule we should not make them visible to the submodule itself until they are actually imported. Marking exports visible before import would cause bizarre behaviour with local submodule visibility, because it happened before we discovered the submodule's transitive imports and could fail to make them visible in the parent module depending on whether the submodules involved were explicitly defined (module X) or implicitly defined from an umbrella (module *). rdar://136524433 (cherry picked from commit 4bb04d4)
Author
|
@swift-ci please test |
Author
|
@swift-ci please test llvm |
akyrtzi
approved these changes
Feb 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.