[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
This commit is contained in:
Alex Lorenz
2023-09-12 18:18:10 -07:00
parent 79cdadf93d
commit 4858cb6225
161 changed files with 396 additions and 384 deletions

View File

@@ -44,7 +44,7 @@ public class C<R> {
// SIL-LABEL: // C.f<A>(_:)
// IR-LABEL: define {{.*}} @"$s1A1CC1fyyqd__lF"
// IR-SAME: nocapture %[[ARG_0:.*]], {{.*}} %[[ARG_S:.*]],
// IR-SAME: %[[ARG_0:.*]], {{.*}} %[[ARG_S:.*]],
#sourceLocation(file: "f.swift", line: 1)
public func f<S>(_ s: S) {
// SIL: debug_value %0 : $*S, let, name "s", argno 1, expr op_deref, {{.*}} scope [[F]]