Files
swift-mirror/test/SILOptimizer/opt-remark-generator-force-emit-implicit-autogen.swift
Michael Gottesman ac64ad6f85 [opt-remark] Add remarks for alloc_box, alloc_ref, alloc_stack
Specifically, we can identify rr on alloc_stack, alloc_ref, alloc_box and also
can emit a remark if ref,box result in heap allocations.
2020-08-22 19:19:13 -07:00

17 lines
834 B
Swift

// RUN: %target-swiftc_driver -O -Rpass-missed=sil-opt-remark-gen -Xllvm -sil-disable-pass=FunctionSignatureOpts -emit-sil %s -o /dev/null -Xfrontend -verify -Xllvm -optremarkgen-visit-implicit-autogen-funcs=1
// From the constructor.
class Klass {} // expected-remark {{heap allocated ref of type 'Klass'}}
struct KlassPair {
var lhs: Klass // expected-remark {{retain of type 'Klass'}}
// expected-note @-1 {{of 'self.lhs'}}
// expected-remark @-2 {{release of type 'Klass'}}
// expected-note @-3 {{of 'self.lhs'}}
var rhs: Klass // expected-remark {{retain of type 'Klass'}}
// expected-note @-1 {{of 'self.rhs'}}
// expected-remark @-2 {{release of type 'Klass'}}
// expected-note @-3 {{of 'self.rhs'}}
}