Skip to content

Commit fe72e81

Browse files
committed
Enable access markers at -O when -enforce-exclusivity is explicit.
-enforce-exclusivity=checked now does what it says. It emits checks at -O, not just -Onone. This does not change the default. -Onone default: -enforce-exclusivity=checked -O default: -enforce-exclusivity=unchecked
1 parent d96306f commit fe72e81

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/SILOptimizer/Mandatory/AccessMarkerElimination.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ using namespace swift;
3636
// This is currently unsupported because tail duplication results in
3737
// address-type block arguments.
3838
llvm::cl::opt<bool> EnableOptimizedAccessMarkers(
39-
"sil-optimized-access-markers", llvm::cl::init(false),
39+
"sil-optimized-access-markers", llvm::cl::init(true),
4040
llvm::cl::desc("Enable memory access markers during optimization passes."));
4141

4242
namespace {

test/SILOptimizer/access_marker_verify.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// RUN: %target-swift-frontend -enable-verify-exclusivity -enforce-exclusivity=checked -enable-sil-ownership -Onone -emit-silgen -swift-version 4 -parse-as-library %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -enable-verify-exclusivity -enforce-exclusivity=checked -enable-sil-ownership -emit-silgen -swift-version 4 -parse-as-library %s | %FileCheck %s
22
// RUN: %target-swift-frontend -enable-verify-exclusivity -enforce-exclusivity=checked -enable-sil-ownership -Onone -emit-sil -swift-version 4 -parse-as-library %s
3+
// RUN: %target-swift-frontend -enable-verify-exclusivity -enforce-exclusivity=checked -enable-sil-ownership -O -emit-sil -swift-version 4 -parse-as-library %s
34
// REQUIRES: asserts
45

56
// Test the combination of SILGen + DiagnoseStaticExclusivity with verification.

0 commit comments

Comments
 (0)