Skip to content

Commit 34b560f

Browse files
authored
[NFC] Give test input header a meaningful name. (#32386)
Re-name the file "foo.h" in the SILOptimizer inputs to "TypesWithUserProvidedDestructor.h" which better describes its purpose (to define types with user provided destructors).
1 parent 2b9fd78 commit 34b560f

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#ifndef TEST_SIL_OPTIMIZER_CXX_WITH_CUSTOM_DESTRUCTOR_H
2+
#define TEST_SIL_OPTIMIZER_CXX_WITH_CUSTOM_DESTRUCTOR_H
3+
4+
struct HasUserProvidedDestructor {
5+
int x;
6+
~HasUserProvidedDestructor() {}
7+
};
8+
9+
struct Loadable {
10+
int x;
11+
};
12+
13+
struct HasMemberWithUserProvidedDestructor {
14+
Loadable y;
15+
~HasMemberWithUserProvidedDestructor() {}
16+
};
17+
18+
#endif // TEST_SIL_OPTIMIZER_CXX_WITH_CUSTOM_DESTRUCTOR_H

test/SILOptimizer/Inputs/foo.h

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module Foo {
2-
header "foo.h"
1+
module CXXTypesWithUserProvidedDestructor {
2+
header "CXXTypesWithUserProvidedDestructor.h"
33
}

test/SILOptimizer/dont_broaden_cxx_address_only.sil

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ sil_stage canonical
55
import Builtin
66
import Swift
77
import SwiftShims
8-
import Foo
8+
import CXXTypesWithUserProvidedDestructor
99

10-
// Make sure we don't try to create a struct here. Foo is not loadable, even
10+
// Make sure we don't try to create a struct here. HasUserProvidedDestructor is not loadable, even
1111
// though it's only property is.
1212
// CHECK-LABEL: @test_foo
1313
// CHECK: bb0
@@ -16,16 +16,16 @@ import Foo
1616
// CHECK-NEXT: tuple
1717
// CHECK-NEXT: return
1818
// CHECK-LABEL: end sil function 'test_foo'
19-
sil shared [transparent] [serializable] [ossa] @test_foo : $@convention(method) (Int32, @thin Foo.Type) -> @out Foo {
20-
bb0(%0 : $*Foo, %1 : $Int32, %2 : $@thin Foo.Type):
21-
%3 = struct_element_addr %0 : $*Foo, #Foo.x
19+
sil shared [transparent] [serializable] [ossa] @test_foo : $@convention(method) (Int32, @thin HasUserProvidedDestructor.Type) -> @out HasUserProvidedDestructor {
20+
bb0(%0 : $*HasUserProvidedDestructor, %1 : $Int32, %2 : $@thin HasUserProvidedDestructor.Type):
21+
%3 = struct_element_addr %0 : $*HasUserProvidedDestructor, #HasUserProvidedDestructor.x
2222
store %1 to [trivial] %3 : $*Int32
2323
%5 = tuple ()
2424
return %5 : $()
2525
}
2626

2727
// Make sure we create a struct for the first (loadable) type but not the second
28-
// type (Bar).
28+
// type (HasMemberWithUserProvidedDestructor).
2929
// CHECK-LABEL: @test_bar
3030
// CHECK: bb0
3131
// CHECK-NEXT: [[E:%.*]] = struct_element_addr
@@ -34,9 +34,9 @@ bb0(%0 : $*Foo, %1 : $Int32, %2 : $@thin Foo.Type):
3434
// CHECK-NEXT: tuple
3535
// CHECK-NEXT: return
3636
// CHECK-LABEL: end sil function 'test_bar'
37-
sil shared [transparent] [serializable] [ossa] @test_bar : $@convention(method) (Int32, @thin Bar.Type) -> @out Bar {
38-
bb0(%0 : $*Bar, %1 : $Int32, %2 : $@thin Bar.Type):
39-
%3 = struct_element_addr %0 : $*Bar, #Bar.y
37+
sil shared [transparent] [serializable] [ossa] @test_bar : $@convention(method) (Int32, @thin HasMemberWithUserProvidedDestructor.Type) -> @out HasMemberWithUserProvidedDestructor {
38+
bb0(%0 : $*HasMemberWithUserProvidedDestructor, %1 : $Int32, %2 : $@thin HasMemberWithUserProvidedDestructor.Type):
39+
%3 = struct_element_addr %0 : $*HasMemberWithUserProvidedDestructor, #HasMemberWithUserProvidedDestructor.y
4040
%3a = struct_element_addr %3 : $*Loadable, #Loadable.x
4141
store %1 to [trivial] %3a : $*Int32
4242
%5 = tuple ()

0 commit comments

Comments
 (0)