-
Notifications
You must be signed in to change notification settings - Fork 341
[APINotes] For a re-exported module, look for APINotes in the re-exporting module's apinotes file #8063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
// If module FooCore is re-exported through module Foo, try Foo.apinotes. | ||
if (!ExportedModuleName.empty()) | ||
if (auto File = findAPINotesFile(Dir, ExportedModuleName, | ||
/*WantPublic=*/true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we forcing public? Private modules can export_as
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, wasn't aware of that, fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we could upstream first?
…rting module's apinotes file If module FooCore is re-exported through module Foo (by using `export_as` in the modulemap), look for attributes of FooCore symbols in Foo.apinotes file. Swift bundles `std.apinotes` file that adds Swift-specific attributes to the C++ stdlib symbols. In recent versions of libc++, module std got split into multiple top-level modules, each of them is re-exported through std. This change allows us to keep using a single modulemap file for all supported C++ stdlibs. rdar://121680760
00437c2
to
5084e0e
Compare
@compnerd we don't have enough APINotes logic upstreamed to run any tests yet, so I wanted to submit a complete PR with tests here first |
@@ -233,6 +234,10 @@ APINotesManager::getCurrentModuleAPINotes(Module *M, bool LookInModule, | |||
|
|||
APINotes.push_back(*File); | |||
} | |||
// If module FooCore is re-exported through module Foo, try Foo.apinotes. | |||
if (!ExportedModuleName.empty()) | |||
if (auto File = findAPINotesFile(Dir, ExportedModuleName, WantPublic)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what happens when the public module of a framework wants to be exported as the private module of a different framework...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Yeah, would probably be good to have a diagnostic to reject that...
…rting module's apinotes file This upstreams swiftlang#8063. If module FooCore is re-exported through module Foo (by using `export_as` in the modulemap), look for attributes of FooCore symbols in Foo.apinotes file. Swift bundles `std.apinotes` file that adds Swift-specific attributes to the C++ stdlib symbols. In recent versions of libc++, module std got split into multiple top-level modules, each of them is re-exported through std. This change allows us to keep using a single modulemap file for all supported C++ stdlibs. rdar://121680760
…rting module's apinotes file This upstreams swiftlang#8063. If module FooCore is re-exported through module Foo (by using `export_as` in the modulemap), look for attributes of FooCore symbols in Foo.apinotes file. Swift bundles `std.apinotes` file that adds Swift-specific attributes to the C++ stdlib symbols. In recent versions of libc++, module std got split into multiple top-level modules, each of them is re-exported through std. This change allows us to keep using a single modulemap file for all supported C++ stdlibs. rdar://121680760
If module FooCore is re-exported through module Foo (by using
export_as
in the modulemap), look for attributes of FooCore symbols in Foo.apinotes file.Swift bundles
std.apinotes
file that adds Swift-specific attributes to the C++ stdlib symbols. In recent versions of libc++, module std got split into multiple top-level modules, each of them is re-exported through std. This change allows us to keep using a single modulemap file for all supported C++ stdlibs.rdar://121680760