mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This is how we originally controlled whether or not we printed out ownership annotations when we printed SIL. Since then, I have changed (a few months ago I believe) the ownership model eliminator to know how to eliminate these annotations from the SIL itself. So this hack can be removed. As an additional benefit, this will let me rename -enable-sil-ownership to -enable-sil-ownership-verifier. This will I hope eliminate confusion around this option in the short term while I am preparing to work on semantic sil again. rdar://42509812
24 lines
1.0 KiB
Plaintext
24 lines
1.0 KiB
Plaintext
// RUN: %target-swift-frontend %s -g -emit-ir -o - | %FileCheck %s
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
import Swift
|
|
|
|
sil @square : $@convention(thin) (Int32) -> Int32 {
|
|
bb0(%0 : @trivial $Int32):
|
|
debug_value %0 : $Int32, let, name "x" // id: %1
|
|
%3 = struct_extract %0 : $Int32, #Int32._value // user: %6
|
|
%4 = struct_extract %0 : $Int32, #Int32._value // user: %6
|
|
%5 = integer_literal $Builtin.Int1, -1 // user: %6
|
|
%6 = builtin "smul_with_overflow_Int32"(%3 : $Builtin.Int32, %4 : $Builtin.Int32, %5 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1) // users: %7, %8
|
|
%7 = tuple_extract %6 : $(Builtin.Int32, Builtin.Int1), 0 // user: %10
|
|
%8 = tuple_extract %6 : $(Builtin.Int32, Builtin.Int1), 1 // user: %9
|
|
cond_fail %8 : $Builtin.Int1 // id: %9
|
|
%10 = struct $Int32 (%7 : $Builtin.Int32) // user: %11
|
|
// CHECK: ret i32 %{{.*}}, !dbg ![[LOC:.*]]
|
|
// CHECK: ![[LOC]] = !DILocation(line: [[@LINE+1]],
|
|
return %10 : $Int32 // id: %11
|
|
}
|
|
|