Skip to content

[Distributed] rename _Distributed to module #41764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -4534,7 +4534,7 @@ ERROR(distributed_actor_isolated_non_self_reference,none,
"non-isolated context",
(DescriptiveDeclKind, DeclName))
ERROR(distributed_actor_needs_explicit_distributed_import,none,
"'_Distributed' module not imported, required for 'distributed actor'",
"'Distributed' module not imported, required for 'distributed actor'",
())
ERROR(actor_isolated_inout_state,none,
"actor-isolated %0 %1 cannot be passed 'inout' to"
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/KnownIdentifiers.def
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ IDENTIFIER(CoreFoundation)
IDENTIFIER(count)
IDENTIFIER(CVarArg)
IDENTIFIER(Darwin)
IDENTIFIER_(Distributed)
IDENTIFIER(Distributed)
IDENTIFIER(dealloc)
IDENTIFIER(debugDescription)
IDENTIFIER(Decodable)
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/TypeCheckRequests.h
Original file line number Diff line number Diff line change
Expand Up @@ -2738,7 +2738,7 @@ class HasCircularRawValueRequest
bool isCached() const { return true; }
};

/// Checks if the _Distributed module is available.
/// Checks if the Distributed module is available.
class DistributedModuleIsAvailableRequest
: public SimpleRequest<DistributedModuleIsAvailableRequest, bool(Decl *),
RequestFlags::Cached> {
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def disable_implicit_concurrency_module_import : Flag<["-"],

def disable_implicit_distributed_module_import : Flag<["-"],
"disable-implicit-distributed-module-import">,
HelpText<"Disable the implicit import of the _Distributed module.">;
HelpText<"Disable the implicit import of the Distributed module.">;

def disable_arc_opts : Flag<["-"], "disable-arc-opts">,
HelpText<"Don't run SIL ARC optimization passes.">;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ constexpr static const StringLiteral SWIFT_ONONE_SUPPORT = "SwiftOnoneSupport";
/// The name of the Concurrency module, which supports that extension.
constexpr static const StringLiteral SWIFT_CONCURRENCY_NAME = "_Concurrency";
/// The name of the Distributed module, which supports that extension.
constexpr static const StringLiteral SWIFT_DISTRIBUTED_NAME = "_Distributed";
constexpr static const StringLiteral SWIFT_DISTRIBUTED_NAME = "Distributed";
/// The name of the StringProcessing module, which supports that extension.
constexpr static const StringLiteral SWIFT_STRING_PROCESSING_NAME = "_StringProcessing";
/// The name of the SwiftShims module, which contains private stdlib decls.
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5569,7 +5569,7 @@ void ProtocolDecl::computeKnownProtocolKind() const {
!module->getName().is("Foundation") &&
!module->getName().is("_Differentiation") &&
!module->getName().is("_Concurrency") &&
!module->getName().is("_Distributed")) {
!module->getName().is("Distributed")) {
const_cast<ProtocolDecl *>(this)->Bits.ProtocolDecl.KnownProtocol = 1;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenDistributed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static void emitDistributedIfRemoteBranch(SILGenFunction &SGF, SILLocation Loc,

FuncDecl *isRemoteFn = ctx.getIsRemoteDistributedActor();
assert(isRemoteFn && "Could not find 'is remote' function, is the "
"'_Distributed' module available?");
"'Distributed' module available?");

ManagedValue selfAnyObject = B.createInitExistentialRef(
Loc, SGF.getLoweredType(ctx.getAnyObjectType()), CanType(selfTy),
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/TypeCheckDistributed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DistributedModuleIsAvailableRequest::evaluate(Evaluator &evaluator,
if (C.getLoadedModule(C.Id_Distributed))
return true;

// seems we're missing the _Distributed module, ask to import it explicitly
// seems we're missing the Distributed module, ask to import it explicitly
decl->diagnose(diag::distributed_actor_needs_explicit_distributed_import);
return false;
}
Expand Down Expand Up @@ -639,7 +639,7 @@ void TypeChecker::checkDistributedActor(SourceFile *SF, NominalTypeDecl *nominal
if (!nominal)
return;

// ==== Ensure the _Distributed module is available,
// ==== Ensure the Distributed module is available,
// without it there's no reason to check the decl in more detail anyway.
if (!swift::ensureDistributedModuleLoaded(nominal))
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckDistributed.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NominalTypeDecl;
/********************* Distributed Actor Type Checking ************************/
/******************************************************************************/

// Diagnose an error if the _Distributed module is not loaded.
// Diagnose an error if the Distributed module is not loaded.
bool ensureDistributedModuleLoaded(Decl *decl);

/// Check for illegal property declarations (e.g. re-declaring transport or id)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/cmake/modules/AddSwiftStdlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ function(add_swift_target_library name)
# Turn off implicit import of _Concurrency when building libraries
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-disable-implicit-concurrency-module-import")

# Turn off implicit import of _Distributed when building libraries
# Turn off implicit import of Distributed when building libraries
if(SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED)
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS
"-Xfrontend;-disable-implicit-distributed-module-import")
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/Distributed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(swift_distributed_link_libraries
swiftCore)


add_swift_target_library(swift_Distributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
add_swift_target_library(swiftDistributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
DistributedActor.cpp
DistributedActor.swift
DistributedActorSystem.swift
Expand All @@ -30,7 +30,7 @@ add_swift_target_library(swift_Distributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
LINK_LIBRARIES ${swift_distributed_link_libraries}

C_COMPILE_FLAGS
-Dswift_Distributed_EXPORTS
-DswiftDistributed_EXPORTS
-I${SWIFT_SOURCE_DIR}/stdlib/include
SWIFT_COMPILE_FLAGS
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/Distributed/DistributedActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ findDistributedAccessor(const char *targetNameStart, size_t targetNameLength) {
}

SWIFT_CC(swift)
SWIFT_EXPORT_FROM(swift_Distributed)
SWIFT_EXPORT_FROM(swiftDistributed)
void *swift_distributed_getGenericEnvironment(const char *targetNameStart,
size_t targetNameLength) {
auto *accessor = findDistributedAccessor(targetNameStart, targetNameLength);
Expand Down Expand Up @@ -65,7 +65,7 @@ using TargetExecutorSignature =
/*throws=*/true>;

SWIFT_CC(swiftasync)
SWIFT_EXPORT_FROM(swift_Distributed)
SWIFT_EXPORT_FROM(swiftDistributed)
TargetExecutorSignature::FunctionType swift_distributed_execute_target;

/// Accessor takes:
Expand Down
16 changes: 8 additions & 8 deletions stdlib/public/Distributed/DistributedMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Swift
///
/// - Returns: May return a negative number to signal a decoding error.
@available(SwiftStdlib 5.7, *)
public // SPI _Distributed
public // SPI Distributed
func _getParameterCount(mangledMethodName name: String) -> Int32 {
let nameUTF8 = Array(name.utf8)
return nameUTF8.withUnsafeBufferPointer { nameUTF8 in
Expand All @@ -27,7 +27,7 @@ func _getParameterCount(mangledMethodName name: String) -> Int32 {

@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_func_getParameterCount")
public // SPI _Distributed
public // SPI Distributed
func __getParameterCount(
_ typeNameStart: UnsafePointer<UInt8>,
_ typeNameLength: UInt
Expand All @@ -39,7 +39,7 @@ func __getParameterCount(
/// - Returns: the actual number of types written,
/// or negative value to signify an error
@available(SwiftStdlib 5.7, *)
public // SPI _Distributed
public // SPI Distributed
func _getParameterTypeInfo(
mangledMethodName name: String,
genericEnv: UnsafeRawPointer?, // GenericEnvironmentDescriptor *
Expand All @@ -58,7 +58,7 @@ func _getParameterTypeInfo(
/// or a negative value to signal decoding error.
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_func_getParameterTypeInfo")
public // SPI _Distributed
public // SPI Distributed
func __getParameterTypeInfo(
_ typeNameStart: UnsafePointer<UInt8>, _ typeNameLength: UInt,
_ genericEnv: UnsafeRawPointer?, // GenericEnvironmentDescriptor *
Expand All @@ -67,7 +67,7 @@ func __getParameterTypeInfo(
) -> Int32

@available(SwiftStdlib 5.7, *)
public // SPI _Distributed
public // SPI Distributed
func _getReturnTypeInfo(
mangledMethodName name: String,
genericEnv: UnsafeRawPointer?, // GenericEnvironmentDescriptor *
Expand All @@ -82,7 +82,7 @@ func _getReturnTypeInfo(

@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_func_getReturnTypeInfo")
public // SPI _Distributed
public // SPI Distributed
func __getReturnTypeInfo(
_ typeNameStart: UnsafePointer<UInt8>,
_ typeNameLength: UInt,
Expand All @@ -95,15 +95,15 @@ func __getReturnTypeInfo(
/// the given distributed target
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_distributed_getGenericEnvironment")
public // SPI _Distributed
public // SPI Distributed
func _getGenericEnvironmentOfDistributedTarget(
_ targetNameStart: UnsafePointer<UInt8>,
_ targetNameLength: UInt
) -> UnsafeRawPointer?

@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_distributed_getWitnessTables")
public // SPI _Distributed
public // SPI Distributed
func _getWitnessTablesFor(
environment: UnsafeRawPointer,
genericArguments: UnsafeRawPointer
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/SwiftShims/Visibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@
#else
#define SWIFT_IMAGE_EXPORTS_swift_Concurrency 0
#endif
#if defined(swift_Distributed_EXPORTS)
#define SWIFT_IMAGE_EXPORTS_swift_Distributed 1
#if defined(swiftDistributed_EXPORTS)
#define SWIFT_IMAGE_EXPORTS_swiftDistributed 1
#else
#define SWIFT_IMAGE_EXPORTS_swift_Distributed 0
#define SWIFT_IMAGE_EXPORTS_swiftDistributed 0
#endif
#if defined(swift_Differentiation_EXPORTS)
#define SWIFT_IMAGE_EXPORTS_swift_Differentiation 1
Expand Down
2 changes: 1 addition & 1 deletion test/Distributed/Inputs/BadDistributedActorSystems.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import _Distributed
import Distributed

// ==== Fake Address -----------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import _Distributed
import Distributed

// ==== Fake Address -----------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import _Distributed
import Distributed


// ==== Fake Transport ---------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import _Distributed
import Distributed

extension DA {
@_dynamicReplacement(for:_remote_hello(other:))
Expand Down
2 changes: 1 addition & 1 deletion test/Distributed/Runtime/distributed_actor_decode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

import _Distributed
import Distributed

distributed actor DA: CustomStringConvertible {
typealias ActorSystem = FakeActorSystem
Expand Down
2 changes: 1 addition & 1 deletion test/Distributed/Runtime/distributed_actor_deinit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed

actor A {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

import _Distributed
import Distributed
import FakeDistributedActorSystems
import FakeCodableForDistributedTests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/../Inputs/FakeDistributedActorSystems.swift
// RUN: %target-build-swift -module-name main -Xfrontend -disable-availability-checking -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -o %t/a.out
// RUN: %target-build-swift -module-name main -Xfrontend -disable-availability-checking -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -o %t/a.out
// RUN: %target-run %t/a.out | %FileCheck %s --color

// REQUIRES: executable_test
Expand All @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/../Inputs/FakeDistributedActorSystems.swift
// RUN: %target-build-swift -module-name main -Xfrontend -disable-availability-checking -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -o %t/a.out
// RUN: %target-build-swift -module-name main -Xfrontend -disable-availability-checking -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -o %t/a.out
// RUN: %target-run %t/a.out | %FileCheck %s --color

// REQUIRES: executable_test
Expand All @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
// UNSUPPORTED: windows

import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
2 changes: 1 addition & 1 deletion test/Distributed/Runtime/distributed_actor_hop_to.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// UNSUPPORTED: windows


import _Distributed
import Distributed
import FakeDistributedActorSystems

typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// REQUIRES: radar_86543336

import _Distributed
import Distributed

enum MyError: Error {
case test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

import _Distributed
import Distributed
import FakeDistributedActorSystems

distributed actor SomeSpecificDistributedActor {
Expand Down
Loading