-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathMoveOnlyUtils.h
48 lines (34 loc) · 1.42 KB
/
MoveOnlyUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//===--- 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