Skip to content

Commit 8ca0f47

Browse files
authored
Merge pull request #60162 from gottesmm/pr-77b3a678646e0dfd66005696d6ae62ade6b23156
[no-implicit-copy] Add an option to turn off performing the copy of subvalue check.
2 parents 6954198 + 5b2fb36 commit 8ca0f47

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyChecker.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040

4141
using namespace swift;
4242

43+
static llvm::cl::opt<bool> RunCopyOfSubValueCheck(
44+
"sil-move-only-checker-perform-copy-of-subvalue-check",
45+
llvm::cl::init(true));
46+
4347
//===----------------------------------------------------------------------===//
4448
// Utilities
4549
//===----------------------------------------------------------------------===//
@@ -809,8 +813,9 @@ bool MoveOnlyChecker::check(NonLocalAccessBlockAnalysis *accessBlockAnalysis,
809813
// introducer. In such a case, a copy is needed but the user needs to use
810814
// _copy to explicit copy the value since they are extracting out a
811815
// subvalue.
812-
if (!copyOfBorrowedProjectionChecker.check(markedValue) ||
813-
!copyOfBorrowedProjectionChecker.shouldEmitDiagnostic()) {
816+
if (RunCopyOfSubValueCheck &&
817+
(!copyOfBorrowedProjectionChecker.check(markedValue) ||
818+
!copyOfBorrowedProjectionChecker.shouldEmitDiagnostic())) {
814819
// If we failed to understand how to perform the check or did not find
815820
// any targets... continue. In the former case we want to fail with a
816821
// checker did not understand diagnostic later and in the former, we

0 commit comments

Comments
 (0)