Skip to content

Commit 8993b0d

Browse files
committed
Address review comments
1 parent b9b6362 commit 8993b0d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/IRGen/AllocStackHoisting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class HoistAllocStack {
332332
};
333333
} // end anonymous namespace
334334

335-
bool indicatesAvailabilityMacroUse(SILInstruction *I) {
335+
bool indicatesDynamicAvailabilityCheckUse(SILInstruction *I) {
336336
auto *Apply = dyn_cast<ApplyInst>(I);
337337
if (!Apply)
338338
return false;
@@ -363,7 +363,7 @@ void HoistAllocStack::collectHoistableInstructions() {
363363
continue;
364364
}
365365
// Don't perform alloc_stack hoisting in functions with availability.
366-
if (indicatesAvailabilityMacroUse(&Inst)) {
366+
if (indicatesDynamicAvailabilityCheckUse(&Inst)) {
367367
AllocStackToHoist.clear();
368368
return;
369369
}

stdlib/public/core/Availability.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public func _stdlib_isOSVersionAtLeast(
2525
_ patch: Builtin.Word
2626
) -> Builtin.Int1 {
2727
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
28+
// The call to _swift_stdlib_operatingSystemVersion is used as an indicator
29+
// that this function was called by a compiler optimization pass. If it is
30+
// replaced that pass needs to be updated.
2831
let runningVersion = _swift_stdlib_operatingSystemVersion()
2932
let queryVersion = _SwiftNSOperatingSystemVersion(
3033
majorVersion: Int(major),

0 commit comments

Comments
 (0)