|
| 1 | +//===---- DistributedActor.h - SIL utils for distributed actors -*- C++ -*-===// |
| 2 | +// |
| 3 | +// This source file is part of the Swift.org open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors |
| 6 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 7 | +// |
| 8 | +// See https://swift.org/LICENSE.txt for license information |
| 9 | +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +#ifndef SWIFT_SILOPTIMIZER_UTILS_DISTRIBUTED_ACTOR_H |
| 14 | +#define SWIFT_SILOPTIMIZER_UTILS_DISTRIBUTED_ACTOR_H |
| 15 | + |
| 16 | +namespace swift { |
| 17 | + |
| 18 | +class ASTContext; |
| 19 | +class ConstructorDecl; |
| 20 | +class ClassDecl; |
| 21 | +class SILBuilder; |
| 22 | +class SILArgument; |
| 23 | +class SILFunction; |
| 24 | +class SILLocation; |
| 25 | +class SILValue; |
| 26 | + |
| 27 | +/// Perform a load of the given distributed actor's transport. |
| 28 | +/// \param actorSelf the value representing `self` for the distributed actor |
| 29 | +/// instance. \returns the transport value |
| 30 | +SILValue loadActorTransport(SILBuilder &B, SILLocation loc, |
| 31 | + ClassDecl *actorDecl, SILValue actorSelf); |
| 32 | + |
| 33 | +/// Emits code that notifies the distributed actor's transport that the |
| 34 | +/// actor is ready for execution. |
| 35 | +/// \param B the builder to use when emitting the code. |
| 36 | +/// \param actor the distributed actor instance to pass to the transport as |
| 37 | +/// being "ready" \param transport a value representing the ActorTransport |
| 38 | +void emitActorReadyCall(SILBuilder &B, SILLocation loc, ClassDecl *actorDecl, |
| 39 | + SILValue actor, SILValue transport); |
| 40 | + |
| 41 | +} // namespace swift |
| 42 | + |
| 43 | +#endif |
0 commit comments