Commit Graph

18 Commits

Author SHA1 Message Date
Alex Lorenz
4858cb6225 [IRGen][interop] do not add 'nocapture' to not bitwise takable types
The use of 'nocapture' for parameters and return values is incorrect for C++ types, as they can actually capture a pointer into its own value (e.g. std::string in libstdc++)

rdar://115062687
2023-09-25 17:43:34 -07:00
Arnold Schwaighofer
3b5ebaa46c Fix some tests in IRGen folder 2023-06-21 10:10:32 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
Arnold Schwaighofer
5a6de1ba77 IRGen: Use opaque storage types for non-fixed indirect result types
LLVM does type based analysis on sret storage types. This is a problem
with non-fixed types whose storage type does not contain the non-fixed
part.

rdar://73778591
2021-02-10 16:19:12 -08:00
Arnold Schwaighofer
1f16f7ad8a Adjust to LLVM change that requires sret parameter attributes to be
annotated with the pointee type.

rdar://71808491
2020-12-03 09:39:41 -08:00
Arnold Schwaighofer
f6651d6d45 IRGen: Enable TypeLayout based value witness generation
rdar://51988441
2020-02-25 12:31:30 -08:00
Arnold Schwaighofer
9ee12db2a9 Fix tests for LLVM change that added anonymous parameter labeling
Fix for r367755.
2019-08-15 14:57:24 -07:00
Michael Gottesman
3ebd8df493 [gardening] Remove unnecessary -enable-sil-ownership from tests that now just get it from their pattern.
This just eliminates -enable-sil-ownership from all target-swift-frontend and
target-swift-emit-silgen RUN lines. Both of those now include
enable-sil-ownership in their expansion.
2019-03-12 20:39:18 -07:00
Michael Gottesman
7c9dfad65c [silgen] Fix a bug where when reabstracting T:P -> P we wrapped a +0 value in an init_existential_ref.
Found via the ownership verifier running on IRGen/outlined_copy_addr.swift.

We treat initialization of an existential as a +1 operation, so there is the
possibility that we would have double destroyed a value. In fixing this I
followed what manageOpaqueValue did on the first code path, since it is handling
this case correctly (and using the SGFContext to do so to boot!).

To ensure this is tested, I enabled ownership verification on the test and since
it seems to be exposing a SILGen code path that we aren't testing currently,
converted it into a SILGen test.
2019-03-11 13:40:26 -07:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Arnold Schwaighofer
448b6b3070 Fix test case 2018-06-14 10:05:12 -07:00
Arnold Schwaighofer
a8fee28fb0 IRGen: Don't outline enum value functions when they involve open existential types
We don't support doing so.

rdar://41009775
2018-06-13 12:48:35 -07:00
Arnold Schwaighofer
34b24220af IRGen: Collect the current type metadata of singleton enums
We have missed the singleton enum case.
rdar://39923978
2018-05-04 13:39:11 -07:00
Slava Pestov
3bc6ec5050 IRGen: Fix outlined_copy_addr test for certain release builds
In some build configurations, LLVM variables don't get names.
2018-04-19 14:09:56 -07: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
Slava Pestov
c31620d302 IRGen: Mangle generic signature and type for outlined thunks 2018-03-26 19:39:26 -07:00
Slava Pestov
8d6b60f8f5 Mangling: Use WO namespace for outlined value operations to declutter W namespace 2018-03-26 19:39:25 -07:00
Joe Shajrawi
9e32ebeb4b [IRGen] Fix a bug In creating outlined copy_addr of generic structs
When dealing with record types, the outliner had a peephole optimization that is apparently invalid in a corner-case (see new test case)
If we added an archetypes then we *have* to emit type metadata for any containing record type, else we might skip one of the “child” records in our recursive type walk
2018-03-14 17:00:23 -07:00