Skip to content

More TBD work #9983

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 4 commits into from
Jun 19, 2017
Merged

More TBD work #9983

merged 4 commits into from
Jun 19, 2017

Conversation

huonw
Copy link
Contributor

@huonw huonw commented May 30, 2017

This includes two somewhat debatable changes, both of which bias the generated TBD towards including extra symbols (i.e. ones that aren't public in the final library) instead of missing them. The logic is that extra symbols should not affect downstream users as much, whereas missing a symbol may cause linker errors.

@huonw
Copy link
Contributor Author

huonw commented May 30, 2017

@swift-ci Please smoke test

1 similar comment
@huonw
Copy link
Contributor Author

huonw commented May 31, 2017

@swift-ci Please smoke test

@huonw
Copy link
Contributor Author

huonw commented May 31, 2017

@swift-ci Please smoke test and merge

tryPush(getSetter());
tryPush(getMaterializeForSetFunc());

if (hasObservers()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can observers and addressors ever be public?

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 don't know if it is correct for them to be public, but yes, it seems that addressors can currently: rdar://problem/32391290

Copy link
Contributor

@jrose-apple jrose-apple Jun 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observers cannot and never will be, addressors can and probably always are.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean addressors are sometimes called directly, and not just via getter/setter/materializeForSet?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, maybe I'm wrong, but I thought so. @rjmccall?

// Field are only direct if the class's internals are completely known.
auto isIndirect = !CD->hasFixedLayout();
addSymbol(LinkEntity::forFieldOffset(var, isIndirect));
// FIXME: a field only has one sort of offset, but it is moderately
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we find a way to use IRGen type lowering from TBDGen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, rdar://problem/32252689 .

@huonw
Copy link
Contributor Author

huonw commented Jun 15, 2017

@swift-ci Please smoke test

@huonw
Copy link
Contributor Author

huonw commented Jun 15, 2017

I've updated this, and the last commit especially is ugly, maybe @slavapestov has some suggestions about manipulating the functions associated with a requirement abstract storage decl?

@huonw
Copy link
Contributor Author

huonw commented Jun 16, 2017

@swift-ci Please smoke test

2 similar comments
@huonw
Copy link
Contributor Author

huonw commented Jun 16, 2017

@swift-ci Please smoke test

@huonw
Copy link
Contributor Author

huonw commented Jun 19, 2017

@swift-ci Please smoke test

huonw added 4 commits June 19, 2017 14:53
It is semantically incorrect to miss a symbol, and just misleading to
include an incorrect one in the TBD file (and, it would take a compiler
bug to actually try to reference one from some downstream code), so it
is better to err on the side of including extra symbols than missing
some.

For now, computing the actual directness of a field is difficult, so
let's include both of them.

Fixes rdar://problem/32253411 .
Unlike some other vars, these members are not also listed at the top
level, adjacent to the VarDecl.
…ls are public.

Specifically, public superprotocols of non-public protocols have some
weird handling in SILGen, so we reproduce this.

Fixes rdar://problem/32254485 .
@huonw
Copy link
Contributor Author

huonw commented Jun 19, 2017

@swift-ci Please smoke test.

@huonw huonw merged commit 406e72d into swiftlang:master Jun 19, 2017
@huonw huonw mentioned this pull request Jun 22, 2017
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.

3 participants