Skip to content

Commit 270336e

Browse files
Merge pull request #82902 from nate-chandler/rdar155059418
[ODL] Visit objc_method insts.
2 parents 72267bb + fc4a493 commit 270336e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyWrappedTypeEliminator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ struct SILMoveOnlyWrappedTypeEliminatorVisitor
241241
NO_UPDATE_NEEDED(ExistentialMetatype)
242242
NO_UPDATE_NEEDED(Builtin)
243243
NO_UPDATE_NEEDED(IgnoredUse)
244+
NO_UPDATE_NEEDED(ObjCMethod)
244245
#undef NO_UPDATE_NEEDED
245246

246247
bool eliminateIdentityCast(SingleValueInstruction *svi) {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
3+
// RUN: %target-swift-frontend %t/Library.swift -sil-verify-all -emit-sil -import-objc-header %t/Header.h > /dev/null
4+
5+
// REQUIRES: objc_interop
6+
7+
//--- Header.h
8+
9+
@import Foundation;
10+
11+
@interface Foo : NSObject
12+
@property (nonatomic, readwrite) NSUInteger length;
13+
@end
14+
15+
//--- Library.swift
16+
17+
func foo(_ x: borrowing Foo) -> UInt {
18+
let y = x.length
19+
return y
20+
}
21+

0 commit comments

Comments
 (0)