Skip to content

Commit 18496c5

Browse files
committed
[Backtracing] Remove support for implicit import of _Backtracing.
We're going to rename the module to Runtime, and it isn't going to be an implicit import, so we don't need any of this. rdar://124913332
1 parent 6b2fb2e commit 18496c5

File tree

18 files changed

+4
-154
lines changed

18 files changed

+4
-154
lines changed

CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,6 @@ option(SWIFT_IMPLICIT_CONCURRENCY_IMPORT
695695
"Implicitly import the Swift concurrency module"
696696
TRUE)
697697

698-
option(SWIFT_IMPLICIT_BACKTRACING_IMPORT
699-
"Implicitly import the Swift backtracing module"
700-
FALSE)
701-
702698
option(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
703699
"Enable build of the Swift concurrency module"
704700
FALSE)
@@ -865,11 +861,6 @@ if (CMAKE_Swift_COMPILER)
865861
SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT)
866862
message(STATUS " Implicit 'string-processing' import: ${SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT}")
867863

868-
# Same for _Backtracing.
869-
swift_supports_implicit_module("backtracing"
870-
SWIFT_SUPPORTS_DISABLE_IMPLICIT_BACKTRACING_MODULE_IMPORT)
871-
message(STATUS " Implicit 'backtracing' import: ${SWIFT_SUPPORTS_DISABLE_IMPLICIT_BACKTRACING_MODULE_IMPORT}")
872-
873864
swift_get_package_cmo_support(
874865
Swift_COMPILER_PACKAGE_CMO_SUPPORT)
875866
message(STATUS " Package CMO: ${Swift_COMPILER_PACKAGE_CMO_SUPPORT}")

cmake/modules/AddPureSwift.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ function(_add_host_swift_compile_options name)
2828
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>")
2929
endif()
3030

31-
# Same for backtracing
32-
if (SWIFT_SUPPORTS_DISABLE_IMPLICIT_BACKTRACING_MODULE_IMPORT)
33-
target_compile_options(${name} PRIVATE
34-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-backtracing-module-import>")
35-
endif()
36-
37-
if(SWIFT_ANALYZE_CODE_COVERAGE)
31+
if(SWIFT_ANALYZE_CODE_COVERAGE)
3832
set(_cov_flags $<$<COMPILE_LANGUAGE:Swift>:-profile-generate -profile-coverage-mapping>)
3933
target_compile_options(${name} PRIVATE ${_cov_flags})
4034
target_link_options(${name} PRIVATE ${_cov_flags})

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ WARNING(warn_implicit_concurrency_import_failed,none,
188188
"unable to perform implicit import of \"_Concurrency\" module: no such module found", ())
189189
REMARK(warn_implicit_string_processing_import_failed,none,
190190
"unable to perform implicit import of \"_StringProcessing\" module: no such module found", ())
191-
REMARK(warn_implicit_backtracing_import_failed,none,
192-
"unable to perform implicit import of \"_Backtracing\" module: no such module found", ())
193191

194192
ERROR(error_bad_module_name,none,
195193
"module name \"%0\" is not a valid identifier"

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,6 @@ namespace swift {
421421
/// Disable the implicit import of the _StringProcessing module.
422422
bool DisableImplicitStringProcessingModuleImport = false;
423423

424-
/// Disable the implicit import of the _Backtracing module.
425-
bool DisableImplicitBacktracingModuleImport =
426-
!SWIFT_IMPLICIT_BACKTRACING_IMPORT;
427-
428424
/// Disable the implicit import of the Cxx module.
429425
bool DisableImplicitCxxModuleImport = false;
430426

include/swift/Config.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#cmakedefine01 SWIFT_IMPLICIT_CONCURRENCY_IMPORT
1212

13-
#cmakedefine01 SWIFT_IMPLICIT_BACKTRACING_IMPORT
14-
1513
#cmakedefine01 SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED
1614

1715
#cmakedefine01 SWIFT_ENABLE_GLOBAL_ISEL_ARM64

include/swift/Frontend/Frontend.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@ class CompilerInvocation {
425425
/// imported.
426426
bool shouldImportSwiftStringProcessing() const;
427427

428-
/// Whether the Swift Backtracing support library should be implicitly
429-
/// imported.
430-
bool shouldImportSwiftBacktracing() const;
431-
432428
/// Whether the CXX module should be implicitly imported.
433429
bool shouldImportCxx() const;
434430

@@ -679,14 +675,6 @@ class CompilerInstance {
679675
/// i.e. if it can be found.
680676
bool canImportSwiftStringProcessing() const;
681677

682-
/// Verify that if an implicit import of the `Backtracing` module if
683-
/// expected, it can actually be imported. Emit a warning, otherwise.
684-
void verifyImplicitBacktracingImport();
685-
686-
/// Whether the Swift Backtracing support library can be imported
687-
/// i.e. if it can be found.
688-
bool canImportSwiftBacktracing() const;
689-
690678
/// Whether the Cxx library can be imported
691679
bool canImportCxx() const;
692680

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,6 @@ def disable_implicit_string_processing_module_import : Flag<["-"],
517517
"disable-implicit-string-processing-module-import">,
518518
HelpText<"Disable the implicit import of the _StringProcessing module.">;
519519

520-
def enable_implicit_backtracing_module_import : Flag<["-"],
521-
"enable-implicit-backtracing-module-import">,
522-
HelpText<"Enable the implicit import of the _Backtracing module.">;
523-
524-
def disable_implicit_backtracing_module_import : Flag<["-"],
525-
"disable-implicit-backtracing-module-import">,
526-
HelpText<"Disable the implicit import of the _Backtracing module.">;
527-
528520
def disable_implicit_cxx_module_import : Flag<["-"],
529521
"disable-implicit-cxx-module-import">,
530522
HelpText<"Disable the implicit import of the C++ Standard Library module.">;

include/swift/Strings.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ constexpr static const StringLiteral SWIFT_MODULE_ABI_NAME_PREFIX = "Compiler";
3333
constexpr static const StringLiteral SWIFT_DISTRIBUTED_NAME = "Distributed";
3434
/// The name of the StringProcessing module, which supports that extension.
3535
constexpr static const StringLiteral SWIFT_STRING_PROCESSING_NAME = "_StringProcessing";
36-
/// The name of the Backtracing module, which supports that extension.
37-
constexpr static const StringLiteral SWIFT_BACKTRACING_NAME = "_Backtracing";
3836
/// The name of the SwiftShims module, which contains private stdlib decls.
3937
constexpr static const StringLiteral SWIFT_SHIMS_NAME = "SwiftShims";
4038
/// The name of the CxxShim module, which contains a cxx casting utility.

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -939,11 +939,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
939939
Opts.DisableImplicitCxxModuleImport |=
940940
Args.hasArg(OPT_disable_implicit_cxx_module_import);
941941

942-
Opts.DisableImplicitBacktracingModuleImport =
943-
Args.hasFlag(OPT_disable_implicit_backtracing_module_import,
944-
OPT_enable_implicit_backtracing_module_import,
945-
true);
946-
947942
if (Args.hasArg(OPT_enable_experimental_async_top_level))
948943
Diags.diagnose(SourceLoc(), diag::warn_flag_deprecated,
949944
"-enable-experimental-async-top-level");

lib/Frontend/Frontend.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,20 +1109,6 @@ bool CompilerInvocation::shouldImportSwiftStringProcessing() const {
11091109
FrontendOptions::ParseInputMode::SwiftModuleInterface;
11101110
}
11111111

1112-
/// Enable Swift backtracing on a per-target basis
1113-
static bool shouldImportSwiftBacktracingByDefault(const llvm::Triple &target) {
1114-
if (target.isOSDarwin() || target.isOSWindows() || target.isOSLinux())
1115-
return true;
1116-
return false;
1117-
}
1118-
1119-
bool CompilerInvocation::shouldImportSwiftBacktracing() const {
1120-
return shouldImportSwiftBacktracingByDefault(getLangOptions().Target) &&
1121-
!getLangOptions().DisableImplicitBacktracingModuleImport &&
1122-
getFrontendOptions().InputMode !=
1123-
FrontendOptions::ParseInputMode::SwiftModuleInterface;
1124-
}
1125-
11261112
bool CompilerInvocation::shouldImportCxx() const {
11271113
// C++ Interop is disabled
11281114
if (!getLangOptions().EnableCXXInterop)
@@ -1209,21 +1195,6 @@ bool CompilerInstance::canImportSwiftStringProcessing() const {
12091195
return getASTContext().testImportModule(modulePath);
12101196
}
12111197

1212-
void CompilerInstance::verifyImplicitBacktracingImport() {
1213-
if (Invocation.shouldImportSwiftBacktracing() &&
1214-
!canImportSwiftBacktracing()) {
1215-
Diagnostics.diagnose(SourceLoc(),
1216-
diag::warn_implicit_backtracing_import_failed);
1217-
}
1218-
}
1219-
1220-
bool CompilerInstance::canImportSwiftBacktracing() const {
1221-
ImportPath::Module::Builder builder(
1222-
getASTContext().getIdentifier(SWIFT_BACKTRACING_NAME));
1223-
auto modulePath = builder.get();
1224-
return getASTContext().testImportModule(modulePath);
1225-
}
1226-
12271198
bool CompilerInstance::canImportCxx() const {
12281199
ImportPath::Module::Builder builder(
12291200
getASTContext().getIdentifier(CXX_MODULE_NAME));
@@ -1321,19 +1292,6 @@ ImplicitImportInfo CompilerInstance::getImplicitImportInfo() const {
13211292
}
13221293
}
13231294

1324-
if (Invocation.shouldImportSwiftBacktracing()) {
1325-
switch (imports.StdlibKind) {
1326-
case ImplicitStdlibKind::Builtin:
1327-
case ImplicitStdlibKind::None:
1328-
break;
1329-
1330-
case ImplicitStdlibKind::Stdlib:
1331-
if (canImportSwiftBacktracing())
1332-
pushImport(SWIFT_BACKTRACING_NAME);
1333-
break;
1334-
}
1335-
}
1336-
13371295
if (Invocation.getLangOptions().EnableCXXInterop) {
13381296
if (Invocation.shouldImportCxx() && canImportCxx())
13391297
pushImport(CXX_MODULE_NAME);

0 commit comments

Comments
 (0)