Skip to content

Commit fc4a493

Browse files
committed
[ODL] Visit objc_method insts.
No update is needed for the values they produce. This pass should really be refactored not to crash on instructions that aren't explicitly listed or at least not to compile if not every instruction is listed. rdar://155059418
1 parent 2253697 commit fc4a493

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)