mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Removes the _getBuiltinLogicValue intrinsic in favor of an open-coded struct_extract in SIL. This removes Sema's last non-literal use of builtin integer types and unblocks a bunch of cleanup. This patch would be NFC, but it improves line information for conditional expression codegen.
20 lines
996 B
Swift
20 lines
996 B
Swift
// RUN: %target-swift-frontend -enable-experimental-static-assert -emit-silgen %s | %FileCheck %s
|
|
|
|
// CHECK-LABEL: sil hidden [ossa] @$s12pound_assert15noCustomMessage{{[_0-9a-zA-Z]*}}
|
|
func noCustomMessage() {
|
|
#assert(true)
|
|
// CHECK: [[LOGIC_VALUE:%.*]] = struct_extract {{.*}}
|
|
// CHECK-NEXT: [[MESSAGE:%.*]] = string_literal utf8 ""
|
|
// CHECK-NEXT: builtin "poundAssert"([[LOGIC_VALUE]] : $Builtin.Int1, [[MESSAGE]] : $Builtin.RawPointer)
|
|
}
|
|
// CHECK: } // end sil function '$s12pound_assert15noCustomMessage{{[_0-9a-zA-Z]*}}'
|
|
|
|
// CHECK-LABEL: sil hidden [ossa] @$s12pound_assert13customMessage{{[_0-9a-zA-Z]*}}
|
|
func customMessage() {
|
|
#assert(true, "custom message")
|
|
// CHECK: [[LOGIC_VALUE:%.*]] = struct_extract {{.*}}
|
|
// CHECK-NEXT: [[MESSAGE:%.*]] = string_literal utf8 "custom message"
|
|
// CHECK-NEXT: builtin "poundAssert"([[LOGIC_VALUE]] : $Builtin.Int1, [[MESSAGE]] : $Builtin.RawPointer)
|
|
}
|
|
// CHECK: } // end sil function '$s12pound_assert13customMessage{{[_0-9a-zA-Z]*}}'
|