mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
At some point, pass definitions were heavily macro-ized. Pass descriptive names were added in two places. This is not only redundant but a source of confusion. You could waste a lot of time grepping for the wrong string. I removed all the getName() overrides which, at around 90 passes, was a fairly significant amount of code bloat. Any pass that we want to be able to invoke by name from a tool (sil-opt) or pipeline plan *should* have unique type name, enum value, commend-line string, and name string. I removed a comment about the various inliner passes that contradicted that. Side note: We should be consistent with the policy that a pass is identified by its type. We have a couple passes, LICM and CSE, which currently violate that convention.
24 lines
584 B
Swift
24 lines
584 B
Swift
// RUN: %target-swift-frontend -O -Xllvm -sil-disable-pass="Function Inlining" -emit-sil -primary-file %s | %FileCheck %s
|
|
|
|
// Check if GlobalOpt generates the getters with the right linkage and the right mangling
|
|
|
|
struct MyStruct {
|
|
static let StaticVar = 10
|
|
}
|
|
|
|
let Global = 27
|
|
|
|
func testit() -> Int {
|
|
return MyStruct.StaticVar + Global
|
|
}
|
|
|
|
_ = testit()
|
|
|
|
// CHECK: sil hidden @{{.*}}testit
|
|
|
|
// CHECK: // MyStruct.StaticVar.getter
|
|
// CHECK-NEXT: sil private [serialized] @_{{.*}}StaticVar
|
|
|
|
// CHECK: // Global.getter
|
|
// CHECK-NEXT: sil private [serialized] @_{{.*}}Global
|