mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix AccessEnforcementReleaseSinking. Check for illegal cases.
In the included, test case, the optimization was sinking releases past is_escaping_closure. Rewrite the isBarrier logic to be conservative and define the mayCheckRefCount property in SIL/InstructionUtils. Properties that may need to be updated when SIL changes belong there. Note that it is particularly bad behavior if the presence of access markers in the code cause miscompiles unrelated to access enforcement. Fixes <rdar://problem/45846920> TestFoundation, TestProcess, closure argument passed as @noescape to Objective-C has escaped.
This commit is contained in:
@@ -70,13 +70,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define DEBUG_TYPE "sil-rr-code-motion"
|
||||
#include "swift/SIL/InstructionUtils.h"
|
||||
#include "swift/SIL/SILBuilder.h"
|
||||
#include "swift/SILOptimizer/Analysis/ARCAnalysis.h"
|
||||
#include "swift/SILOptimizer/Analysis/AliasAnalysis.h"
|
||||
#include "swift/SILOptimizer/Analysis/EscapeAnalysis.h"
|
||||
#include "swift/SILOptimizer/Analysis/PostOrderAnalysis.h"
|
||||
#include "swift/SILOptimizer/Analysis/RCIdentityAnalysis.h"
|
||||
#include "swift/SILOptimizer/Analysis/ProgramTerminationAnalysis.h"
|
||||
#include "swift/SILOptimizer/Analysis/RCIdentityAnalysis.h"
|
||||
#include "swift/SILOptimizer/PassManager/Passes.h"
|
||||
#include "swift/SILOptimizer/PassManager/Transforms.h"
|
||||
#include "swift/SILOptimizer/Utils/CFG.h"
|
||||
|
||||
Reference in New Issue
Block a user