Commit Graph

12 Commits

Author SHA1 Message Date
Slava Pestov
4d18e923d4 SIL: Clean up includes 2017-12-19 02:00:25 -08:00
Slava Pestov
fa719f75bd SIL: SILVTableVisitor no longer needs a TypeLowering reference 2017-12-18 23:28:33 -08:00
Slava Pestov
c16c2c35bf SIL: Move getOverriddenVTableEntry() from TypeLowering to SILDeclRef
There's no reason for this to be an instance method on the TypeLowering
object, because it (no longer?) uses any type lowering operations.
2017-12-18 23:28:33 -08:00
Slava Pestov
ce2a434587 SILGen: Fix bug with vtable entries for allocating initializers
Some changes I was working on uncovered a latent bug where we would
emit a class_method instruction to call an allocating initializer
that did not have a vtable entry.

Previously this wasn't caught because the only example of this in
our test suite was in test/SILGen/objc_bridging_any.swift, which
did not test with IRGen; if it did, an IRGen crash would have been
observed.

Factor out some code duplication to prevent this from happening
again, and add a SILGen test that we emit a vtable entry in this
case, and that the test case passes IRGen also.
2017-11-11 02:01:50 -08:00
Joe Groff
c374763632 SILGen: Fix override handling when a dynamic init is also required.
A missed case from #11107. Fixes SR-5542 | rdar://problem/33490780.
2017-07-25 10:24:19 -07:00
Jordan Rose
384b2a674b Actually honor MissingMemberDecls in ClassMetadataScanner.
...which is sufficient to correctly invoke methods in a vtable
even when members have been deleted. 🎉
2017-05-10 12:41:22 -06:00
Jordan Rose
6c098033de Lift the decision of whether a method needs a vtable slot up to AST.
This lets us serialize that decision, which means we can conceivably
/change/ the decision in later versions of the compiler without
breaking existing code. More immediately, it's groundwork that will
eventually allow us to drop decls from the AST without affecting
vtable layout.

This isn't actually a great answer; what we really want is for SIL
vtables to be serialized consistently and treated as the point of
truth. But that would be more change than we're comfortable taking in
the Swift 4 timeframe.

First part of rdar://problem/31878396.
2017-05-04 17:49:47 -07:00
practicalswift
b704f1448b [gardening] Improve header consistency 2017-04-12 15:13:11 +02:00
Slava Pestov
7aabd80898 SIL: Stub out TypeConverter::getOverriddenVTableEntry()
This replaces SILDeclRef::getBaseOverriddenVTableEntry(). It lives
in the TypeConverter because it needs to use type lowering information
to determine if the method requires a new vtable entry or not.
2017-03-24 01:53:39 -07:00
Slava Pestov
ef7f6bf0ea SIL: Stub out TypeConverter::requiresNewVTableEntry() 2017-03-24 01:52:42 -07:00
Slava Pestov
aebf843dda SIL: Addressors don't need vtable entries
In the old vtable emission code, IRGen would skip addressors,
but they had entries in the SILVTable. This is still correct
behavior, so skip addressors explicitly in SILVTableVisitor.

We never call addressors dynamically, only inside a getter,
setter or materializeForSet. When a property with addressors
is overridden we provide new getters and setters (which may
or may not statically dispatch to a peer addressor).
2017-03-23 20:36:12 -07:00
Slava Pestov
c94e6b8a5e SIL: Add new SILVTableVisitor
This is a CRTP utility to walk the members of a class and
produce vtable entries. It will be used to clean up some
code duplication between SILGen and IRGen, and to provide
missing functionality for multiple vtable entries per
method.
2017-03-23 18:17:42 -07:00