Commit Graph

11 Commits

Author SHA1 Message Date
Arnold Schwaighofer
b7a58c0f96 IRGen: Optionally use value witness instead of outlined value functions
... if type layout based value witness emission is enabled.

rdar://51988441
2020-02-21 12:10:58 -08:00
Dan Zheng
1486d6b346 NFC: Add GenericSignature::getCanonicalSignature. (#29105)
Motivation: `GenericSignatureImpl::getCanonicalSignature` crashes for
`GenericSignature` with underlying `nullptr`. This led to verbose workarounds
when computing `CanGenericSignature` from `GenericSignature`.

Solution: `GenericSignature::getCanonicalSignature` is a wrapper around
`GenericSignatureImpl::getCanonicalSignature` that returns the canonical
signature, or `nullptr` if the underlying pointer is `nullptr`.

Rewrite all verbose workarounds using `GenericSignature::getCanonicalSignature`.
2020-01-12 12:17:41 -08:00
Arnold Schwaighofer
781582b205 IRGen: Add addLoweredTypeRef API and use it for capture and
box descriptors

We want to substitute opaque result types in addTypeRef but when we pass
SILFunctionTypes this would fail because AST type substitution does not
support lowered SIL types.

Instead add addLoweredTypeRef which substitutes based on SILTypes.

rdar://54529445
2019-08-22 13:40:38 -07:00
Arnold Schwaighofer
86ca8146a0 IRGen: Fix outlining when an opaque type resolves to a fixed size type
rdar://54515130
2019-08-20 09:47:01 -07:00
Arnold Schwaighofer
b082c270f5 IRGen: Outlining needs to look through opaque archetypes now that the rest of IRGen does
rdar://54470626
2019-08-19 14:18:19 -07:00
Joe Groff
0cfca9496a Give opened archetypes a generic environment.
And maybe allow nested types to live on them.
2019-02-20 12:52:48 -08:00
Joe Groff
89979137fc Push ArchetypeType's API down to subclasses.
And clean up code that conditionally works only with certain kinds of archetype along the way.
2018-12-12 19:45:40 -08:00
Arnold Schwaighofer
97845c0a5c IRGen: Don't pass metadata of not ABI accessible to outlined copy/destroy operations
Doing so will cause linkage errors and is not neccessary since we call
the witness of the enclosing type as soon as its fields are not ABI
accessible.

rdar://40868358
2018-06-07 13:58:01 -07:00
David Zarzycki
8c0c55539f [SIL] NFC: Rename misleading getSwiftRValueType() to getASTType()
Reference storage types are not RValues. Also, use more SILType helper
methods to avoid line wrap.
2018-05-04 08:14:38 -04:00
Slava Pestov
39a65abf85 IRGen: Outlined thunks don't need to receive fixed-size metadata
They're not used inside the thunk so it's a waste passing them in, and
if they involve private types from a different translation unit we will
get a linking error from referencing the metadata accessor function.

Fixes the test case in <rdar://problem/39470607>, but the more general
problem remains.
2018-04-17 16:11:21 -07:00
John McCall
976401157f Bind layout type metadata correctly in outlined helper functions.
Fixes a regression in the source compatibility suite which I had a
lot of trouble extracting into a separate test case.

Most of this patch is just moving the outlining code into a separate
file and organizing it into a helper class instead of copy/pasting
so much code.  The main functional change is implicit in the difference
between collecting formal metadata and collecting it for layout, which
then is exploited in bindMetadataParameters.

As a secondary change, stop collecting metadata for class-bounded
archetypes; we don't actually need it to do value operations.
2018-03-27 15:14:12 -04:00