Files
swift-mirror/include/swift/Sema/Concurrency.h
Michael Gottesman bbc4816861 [sema] Move getConcurrencyDiagnosticBehaviorLimit and hasExplicitSendableConformance out of Sema and into libAST.
I am going to expose this on TypeBase, so I am attempting to prevent a layering
violation in between AST and Sema.
2024-08-23 20:42:51 -04:00

49 lines
1.5 KiB
C++

//===--- Concurrency.h ----------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2024 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
//
//===----------------------------------------------------------------------===//
///
/// \file
///
/// This file defines concurrency utility routines from Sema that are used by
/// later parts of the compiler like the pass pipeline.
///
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SEMA_CONCURRENCY_H
#define SWIFT_SEMA_CONCURRENCY_H
#include <optional>
namespace swift {
class DeclContext;
class SourceFile;
class NominalTypeDecl;
class VarDecl;
struct DiagnosticBehavior;
/// If any of the imports in this source file was @preconcurrency but there were
/// no diagnostics downgraded or suppressed due to that @preconcurrency, suggest
/// that the attribute be removed.
void diagnoseUnnecessaryPreconcurrencyImports(SourceFile &sf);
/// Diagnose the use of an instance property of non-sendable type from an
/// nonisolated deinitializer within an actor-isolated type.
///
/// \returns true iff a diagnostic was emitted for this reference.
bool diagnoseNonSendableFromDeinit(
SourceLoc refLoc, VarDecl *var, DeclContext *dc);
} // namespace swift
#endif