Commit Graph

19 Commits

Author SHA1 Message Date
Nate Chandler
e507a6bcea [IRGen] Defer materializing metadata for outlining
Rather than materializing the metadata on demand during visitation, only
collect the types that may be required.  Finally, materialize everything
that's needed at the end.
2024-03-15 14:12:28 -07:00
Nate Chandler
0075682b4d [IRGen] Single payload enums consumes call deinits
The include the necessary metadata.
2024-03-01 21:01:50 -08:00
Nate Chandler
f37d2a21e4 [Gardening] IRGen: Doc'd method. 2024-03-01 21:01:50 -08:00
Nate Chandler
9a8c814553 [Outlining] Pass polymorphic args of type.
If any deinit must be called, just pass the full generic environment of
the type being destroyed.
2024-03-01 21:01:50 -08:00
Nate Chandler
3f6bd9d3e1 [NFC] IRGen: Store SILType in metadata collector. 2024-03-01 21:01:49 -08:00
Nate Chandler
babdbda2d4 [NFC] IRGen: Moved constructor to cpp. 2024-03-01 21:01:49 -08:00
Nate Chandler
73ccf1c9fb [NFC] IRGen: Extracted method. 2024-03-01 21:01:49 -08:00
Nate Chandler
a82140bc1c [NFC] IRGen: Renamed method.
Not all metadata that the OutliningMetdataCollector collects is for
layout anymore.
2024-03-01 21:01:49 -08:00
Nate Chandler
1253dba02b [NFC] IRGen: Renamed outlining helpers.
In preparation for them handling more polymorphic arguments than merely
metadata.
2024-03-01 21:01:49 -08:00
Nate Chandler
c867e4c37e [NFC] IRGen: Marked some functions public. 2024-03-01 21:01:49 -08:00
Nate Chandler
fefd793a2a [NFC] IRGen: Renamed method. 2024-03-01 21:01:49 -08:00
Nate Chandler
36b473d365 [IRGen] Pass deinit metadata to outlined release.
Given a releasable value which contains a noncopyable value type with a
deinit, that values outlined release function, among other things, must
call the deinit of that noncopyable value type.  In order to do that,
its type metadata must be passed to the value function if it has an
archetype.
2024-02-21 19:31:52 -08:00
Nate Chandler
f3b9dec880 [IRGen] Collect nc deinit metadata for outlining.
Some outlined functions call deinits for noncopyable values.  These
deinits require the metadata for the full type.

Teach the OutliningMetadataCollector to collect the metadata for these
types, when the new needsDeinit flag is set.

Also add the new needsLayout flag.  For now, all outlined functions need
it.
2024-02-21 19:31:52 -08:00
Nate Chandler
4cd073a841 [Gardening] IRGen: Marked a function private. 2024-02-21 17:53:34 -08:00
Nate Chandler
93595e4e86 [NFC] IRGen: Extracted method. 2024-02-21 17:53:34 -08:00
Becca Royal-Gordon
3eebc6dddb Merge branch 'main' into rebranch
# Conflicts:
#	lib/SILOptimizer/Differentiation/Common.cpp
2023-08-04 15:09:50 -07:00
Tony Allevato
c71c1e193b Ensure types used as std::vector elements are complete.
These were never allowed, but with C++20 making more `vector` functions
`constexpr`, they would start causing build failures in that language
mode.
2023-08-02 15:03:48 -04:00
Evan Wilde
dd5ffc5cd2 More header include fixes
MapVector started querying for constructability of stored types with
templates. As such, we need the definition of `LocalTypeDataKey` so that
it can instantiate the template.

We also lost a transitive include of `TinyPtrVector`, which we use, so
including it in `ConformanceLookupTable.h`.
2023-07-25 14:52:43 -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