mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
I was originally hoping to reuse mark_must_check for multiple types of checkers. In practice, this is not what happened... so giving it a name specifically to do with non copyable types makes more sense and makes the code clearer. Just a pure rename.
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
//===--- MoveOnlyUtils.h --------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef SWIFT_SILOPTIMIZER_MANDATORY_MOVEONLYUTILS_H
|
|
#define SWIFT_SILOPTIMIZER_MANDATORY_MOVEONLYUTILS_H
|
|
|
|
namespace swift {
|
|
|
|
class SILFunction;
|
|
class MarkUnresolvedNonCopyableValueInst;
|
|
class Operand;
|
|
|
|
namespace siloptimizer {
|
|
|
|
class DiagnosticEmitter;
|
|
|
|
bool cleanupNonCopyableCopiesAfterEmittingDiagnostic(SILFunction *fn);
|
|
|
|
/// Emit an error if we missed any copies when running markers. To check if a
|
|
/// diagnostic was emitted, use \p diagnosticEmitter.getDiagnosticCount().
|
|
void emitCheckerMissedCopyOfNonCopyableTypeErrors(
|
|
SILFunction *fn, DiagnosticEmitter &diagnosticEmitter);
|
|
|
|
bool eliminateTemporaryAllocationsFromLet(
|
|
MarkUnresolvedNonCopyableValueInst *markedInst);
|
|
|
|
namespace noncopyable {
|
|
|
|
bool memInstMustConsume(Operand *memOper);
|
|
bool memInstMustReinitialize(Operand *memOper);
|
|
bool memInstMustInitialize(Operand *memOper);
|
|
|
|
} // namespace noncopyable
|
|
|
|
} // namespace siloptimizer
|
|
|
|
} // namespace swift
|
|
|
|
#endif
|