mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Thanks to exclusivity checking, inout arguments can be marked noalias. In the fullness of time, this should be applied in general. As an incremental step towards marking all such arguments noalias, start by marking inout arguments of pointer type noalias. Take this conservative step rather than always applying the attribute to ward against issues with LLVM's alias analysis. rdar://76540030
6 lines
273 B
Swift
6 lines
273 B
Swift
// RUN: %target-swift-frontend %s -emit-ir | %FileCheck %s
|
|
|
|
// CHECK: define{{.*}}swiftcc void @swapPointers({{.*}}noalias{{.*}},{{.*}}noalias{{.*}})
|
|
@_silgen_name("swapPointers")
|
|
public func swapPointers<T>(_ lhs: inout UnsafePointer<T>, _ rhs: inout UnsafePointer<T>) {}
|