Skip to content

Commit 082750c

Browse files
committed
Don't eliminate begin_access [signed] in AccessMarkerElimination
1 parent 3a987ca commit 082750c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/SILOptimizer/Mandatory/AccessMarkerElimination.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ bool AccessMarkerElimination::shouldPreserveAccess(
7777
switch (enforcement) {
7878
case SILAccessEnforcement::Static:
7979
case SILAccessEnforcement::Unsafe:
80-
case SILAccessEnforcement::Signed:
8180
return false;
81+
// Signed access should be preserved until IRGen
82+
case SILAccessEnforcement::Signed:
83+
return true;
8284
case SILAccessEnforcement::Unknown:
8385
case SILAccessEnforcement::Dynamic:
8486
return Mod->getOptions().EnforceExclusivityDynamic;
@@ -100,7 +102,7 @@ AccessMarkerElimination::checkAndEliminateMarker(SILInstruction *inst) {
100102
if (beginAccess->isFromBuiltin())
101103
return inst->getIterator();
102104

103-
// Leave dynamic accesses in place, but delete all others.
105+
// Leave dynamic and signed accesses in place, but delete all others.
104106
if (shouldPreserveAccess(beginAccess->getEnforcement()))
105107
return inst->getIterator();
106108

0 commit comments

Comments
 (0)