Skip to content

[ownership] Fix build due to a missing code change dependency in between two PRs. #35519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
//===----------------------------------------------------------------------===//

#define DEBUG_TYPE "sil-combine"

#include "SILCombiner.h"

#include "swift/AST/GenericSignature.h"
#include "swift/AST/Module.h"
#include "swift/AST/SemanticAttrs.h"
#include "swift/AST/SubstitutionMap.h"
#include "swift/Basic/Range.h"
#include "swift/AST/SemanticAttrs.h"
#include "swift/SIL/DebugUtils.h"
#include "swift/SIL/DynamicCasts.h"
#include "swift/SIL/InstructionUtils.h"
Expand All @@ -29,6 +31,7 @@
#include "swift/SILOptimizer/Utils/CFGOptUtils.h"
#include "swift/SILOptimizer/Utils/Existential.h"
#include "swift/SILOptimizer/Utils/KeyPathProjector.h"
#include "swift/SILOptimizer/Utils/OwnershipOptUtils.h"
#include "swift/SILOptimizer/Utils/ValueLifetime.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
Expand Down Expand Up @@ -1510,11 +1513,10 @@ bool SILCombiner::optimizeIdentityCastComposition(ApplyInst *fInverseApply,
// First perform an ownership RAUW+erase of arg0 and inverse apply. The OSSA
// RAUW helper will copy arg0 if needed. We need to do this before anything
// else since the utility assumes OSSA is in correct form.
if (!decltype(ownershipRAUWHelper)::canFixUpOwnershipForRAUW(fInverseApply,
arg0)) {
OwnershipRAUWHelper helper(ownershipFixupContext, fInverseApply, arg0);
if (!helper)
return false;
}
ownershipRAUWHelper.replaceAllUsesAndErase(fInverseApply, arg0);
helper.perform();

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