Revert "[cxx-interop][SwiftCompilerSources] Use C++ enums directly from Swift"

This commit is contained in:
eeckstein
2022-09-22 11:45:41 +02:00
committed by GitHub
parent d015505090
commit 69431f00e8
11 changed files with 116 additions and 39 deletions

View File

@@ -124,7 +124,7 @@ private struct StackProtectionOptimization {
mustFixStackNesting: inout Bool, _ context: PassContext) {
// `withUnsafeTemporaryAllocation(of:capacity:_:)` is compiled to a `builtin "stackAlloc"`.
if let bi = instruction as? BuiltinInst, bi.id == .StackAlloc {
if let bi = instruction as? BuiltinInst, bi.id == .stackAlloc {
function.setNeedsStackProtection(context)
return
}
@@ -332,7 +332,7 @@ private struct StackProtectionOptimization {
/// Moves the value of a `beginAccess` to a temporary stack location, if possible.
private func moveToTemporary(scope beginAccess: BeginAccessInst, mustFixStackNesting: inout Bool,
_ context: PassContext) {
if beginAccess.accessKind != .Modify {
if beginAccess.accessKind != .modify {
// We can only move from a `modify` access.
// Also, read-only accesses shouldn't be subject to buffer overflows (because
// no one should ever write to such a storage).