Skip to content

Commit 207bf78

Browse files
authored
Merge pull request #23896 from bob-wilson/branchHint-followup
Move the legacy _branchHint function to LegacyABI.swift
2 parents d82b88c + 0cf186f commit 207bf78

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

stdlib/public/core/Builtin.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,6 @@ func _uncheckedUnsafeAssume(_ condition: Bool) {
301301
_ = Builtin.assume_Int1(condition._value)
302302
}
303303

304-
// This function is no longer used but must be kept for ABI compatibility
305-
// because references to it may have been inlined.
306-
@usableFromInline
307-
internal func _branchHint(_ actual: Bool, expected: Bool) -> Bool {
308-
// The LLVM intrinsic underlying int_expect_Int1 now requires an immediate
309-
// argument for the expected value so we cannot call it here. This should
310-
// never be called in cases where performance matters, so just return the
311-
// value without any branch hint.
312-
return actual
313-
}
314-
315304
//===--- Runtime shim wrappers --------------------------------------------===//
316305

317306
/// Returns `true` iff the class indicated by `theClass` uses native

stdlib/public/core/LegacyABI.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,14 @@ extension Substring {
6060
return try copy.withUTF8(body)
6161
}
6262
}
63+
64+
// This function is no longer used but must be kept for ABI compatibility
65+
// because references to it may have been inlined.
66+
@usableFromInline
67+
internal func _branchHint(_ actual: Bool, expected: Bool) -> Bool {
68+
// The LLVM intrinsic underlying int_expect_Int1 now requires an immediate
69+
// argument for the expected value so we cannot call it here. This should
70+
// never be called in cases where performance matters, so just return the
71+
// value without any branch hint.
72+
return actual
73+
}

0 commit comments

Comments
 (0)