Skip to content

Commit 4ff544b

Browse files
authored
Merge pull request #35519 from gottesmm/pr-65f94930aa094b5eae417d87b19570f2ffc91488
[ownership] Fix build due to a missing code change dependency in between two PRs.
2 parents 1391a82 + 34c0089 commit 4ff544b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#define DEBUG_TYPE "sil-combine"
14+
1415
#include "SILCombiner.h"
16+
1517
#include "swift/AST/GenericSignature.h"
1618
#include "swift/AST/Module.h"
19+
#include "swift/AST/SemanticAttrs.h"
1720
#include "swift/AST/SubstitutionMap.h"
1821
#include "swift/Basic/Range.h"
19-
#include "swift/AST/SemanticAttrs.h"
2022
#include "swift/SIL/DebugUtils.h"
2123
#include "swift/SIL/DynamicCasts.h"
2224
#include "swift/SIL/InstructionUtils.h"
@@ -29,6 +31,7 @@
2931
#include "swift/SILOptimizer/Utils/CFGOptUtils.h"
3032
#include "swift/SILOptimizer/Utils/Existential.h"
3133
#include "swift/SILOptimizer/Utils/KeyPathProjector.h"
34+
#include "swift/SILOptimizer/Utils/OwnershipOptUtils.h"
3235
#include "swift/SILOptimizer/Utils/ValueLifetime.h"
3336
#include "llvm/ADT/DenseMap.h"
3437
#include "llvm/ADT/SmallPtrSet.h"
@@ -1510,11 +1513,10 @@ bool SILCombiner::optimizeIdentityCastComposition(ApplyInst *fInverseApply,
15101513
// First perform an ownership RAUW+erase of arg0 and inverse apply. The OSSA
15111514
// RAUW helper will copy arg0 if needed. We need to do this before anything
15121515
// else since the utility assumes OSSA is in correct form.
1513-
if (!decltype(ownershipRAUWHelper)::canFixUpOwnershipForRAUW(fInverseApply,
1514-
arg0)) {
1516+
OwnershipRAUWHelper helper(ownershipFixupContext, fInverseApply, arg0);
1517+
if (!helper)
15151518
return false;
1516-
}
1517-
ownershipRAUWHelper.replaceAllUsesAndErase(fInverseApply, arg0);
1519+
helper.perform();
15181520

15191521
// Now remove the apply, inserting a destroy_value if we need to it arg0.
15201522
if (fApply->getArgumentRef(0).isLifetimeEnding()) {

0 commit comments

Comments
 (0)