Skip to content

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

Merged
merged 6 commits into from
Apr 7, 2017
Merged

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Apr 6, 2017

Also, use it to generate symbols for conformance witness tables.

@huonw huonw requested review from slavapestov and jckarter April 6, 2017 22:20
@huonw
Copy link
Contributor Author

huonw commented Apr 6, 2017

@swift-ci Please smoke test.

PrimarySourceFile ? validateTBD(PrimarySourceFile, *IRModule)
: validateTBD(Instance->getMainModule(), *IRModule);
if (validationError)
auto hasMultipleIRGenThreads = Invocation.getSILOptions().NumThreads > 1;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

addSymbol(irgen::LinkEntity::forTypeMetadataAccessFunction(declaredType));

// There are symbols associated with any protocols this type conforms to.
for (auto conformance : NTD->getAllConformances()) {
Copy link
Contributor

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?

@@ -35,23 +36,38 @@ static bool isPrivateDecl(ValueDecl *VD) {
namespace {
class TBDGenVisitor : public ASTVisitor<TBDGenVisitor> {
StringSet &Symbols;
const irgen::UniversalLinkageInfo &UniversalLinkInfo;
Copy link
Contributor

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

@huonw
Copy link
Contributor Author

huonw commented Apr 7, 2017

Updated for the review, except for the multiple threads point. And, also, includes a fix for the PublicExternal thing (first commit).

@huonw
Copy link
Contributor Author

huonw commented Apr 7, 2017

@swift-ci Please smoke test.

@slavapestov
Copy link
Contributor

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.

@huonw huonw merged commit 9e9a0a0 into swiftlang:master Apr 7, 2017
@huonw huonw deleted the symbol-list-3 branch April 7, 2017 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants