-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Use IRGen's LinkInfo in TBDGen. #8596
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
@swift-ci Please smoke test. |
PrimarySourceFile ? validateTBD(PrimarySourceFile, *IRModule) | ||
: validateTBD(Instance->getMainModule(), *IRModule); | ||
if (validationError) | ||
auto hasMultipleIRGenThreads = Invocation.getSILOptions().NumThreads > 1; |
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.
This setting should not influence the set of public symbols we emit.
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'm just passing through all the options that IRGen is asking for ( https://github.com/apple/swift/blob/d1c5de1cea6c388c78266cc1b691074d06b6eb33/lib/IRGen/GenDecl.cpp#L1372-L1386 ), to make sure we're matching as closely as possible. If you think this isn't required I'd be very happy to get rid of it.
lib/TBDGen/TBDGen.cpp
Outdated
addSymbol(irgen::LinkEntity::forTypeMetadataAccessFunction(declaredType)); | ||
|
||
// There are symbols associated with any protocols this type conforms to. | ||
for (auto conformance : NTD->getAllConformances()) { |
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.
Isn't there a getLocalConformances() that only returns conformances defined in the same module?
lib/TBDGen/TBDGen.cpp
Outdated
@@ -35,23 +36,38 @@ static bool isPrivateDecl(ValueDecl *VD) { | |||
namespace { | |||
class TBDGenVisitor : public ASTVisitor<TBDGenVisitor> { | |||
StringSet &Symbols; | |||
const irgen::UniversalLinkageInfo &UniversalLinkInfo; |
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.
using namespace swift::irgen; would help IMO
Previously this would be using the current module's resilience strategy, rather than that of the one that contains the conformance.
Updated for the review, except for the multiple threads point. And, also, includes a fix for the PublicExternal thing (first commit). |
@swift-ci Please smoke test. |
Looks good to me. If we need the multiple threads thing to initialize the IRGen it's fine, is just want to be extra careful that it doesn't change symbol visibility. |
Also, use it to generate symbols for conformance witness tables.