Skip to content

Commit 580989d

Browse files
committed
Swift SIL: add Function.mayBindDynamicSelf
1 parent 9d75e3f commit 580989d

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ extension Function {
540540
}
541541
return nil
542542
}
543+
544+
var mayBindDynamicSelf: Bool {
545+
self.bridged.mayBindDynamicSelf()
546+
}
543547
}
544548

545549
extension FullApplySite {

include/swift/SIL/SILBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ struct BridgedFunction {
560560
BRIDGED_INLINE bool hasSemanticsAttr(BridgedStringRef attrName) const;
561561
BRIDGED_INLINE bool hasUnsafeNonEscapableResult() const;
562562
BRIDGED_INLINE bool hasResultDependsOnSelf() const;
563+
bool mayBindDynamicSelf() const;
563564
BRIDGED_INLINE EffectsKind getEffectAttribute() const;
564565
BRIDGED_INLINE PerformanceConstraints getPerformanceConstraints() const;
565566
BRIDGED_INLINE InlineStrategy getInlineStrategy() const;

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,13 @@ void SwiftPassInvocation::endVerifyFunction() {
15401540

15411541
SwiftPassInvocation::~SwiftPassInvocation() {}
15421542

1543+
//===----------------------------------------------------------------------===//
1544+
// SIL Bridging
1545+
//===----------------------------------------------------------------------===//
1546+
bool BridgedFunction::mayBindDynamicSelf() const {
1547+
return swift::mayBindDynamicSelf(getFunction());
1548+
}
1549+
15431550
//===----------------------------------------------------------------------===//
15441551
// OptimizerBridging
15451552
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)