mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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
This commit is contained in:
@@ -1109,20 +1109,6 @@ bool CompilerInvocation::shouldImportSwiftStringProcessing() const {
|
||||
FrontendOptions::ParseInputMode::SwiftModuleInterface;
|
||||
}
|
||||
|
||||
/// Enable Swift backtracing on a per-target basis
|
||||
static bool shouldImportSwiftBacktracingByDefault(const llvm::Triple &target) {
|
||||
if (target.isOSDarwin() || target.isOSWindows() || target.isOSLinux())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CompilerInvocation::shouldImportSwiftBacktracing() const {
|
||||
return shouldImportSwiftBacktracingByDefault(getLangOptions().Target) &&
|
||||
!getLangOptions().DisableImplicitBacktracingModuleImport &&
|
||||
getFrontendOptions().InputMode !=
|
||||
FrontendOptions::ParseInputMode::SwiftModuleInterface;
|
||||
}
|
||||
|
||||
bool CompilerInvocation::shouldImportCxx() const {
|
||||
// C++ Interop is disabled
|
||||
if (!getLangOptions().EnableCXXInterop)
|
||||
@@ -1209,21 +1195,6 @@ bool CompilerInstance::canImportSwiftStringProcessing() const {
|
||||
return getASTContext().testImportModule(modulePath);
|
||||
}
|
||||
|
||||
void CompilerInstance::verifyImplicitBacktracingImport() {
|
||||
if (Invocation.shouldImportSwiftBacktracing() &&
|
||||
!canImportSwiftBacktracing()) {
|
||||
Diagnostics.diagnose(SourceLoc(),
|
||||
diag::warn_implicit_backtracing_import_failed);
|
||||
}
|
||||
}
|
||||
|
||||
bool CompilerInstance::canImportSwiftBacktracing() const {
|
||||
ImportPath::Module::Builder builder(
|
||||
getASTContext().getIdentifier(SWIFT_BACKTRACING_NAME));
|
||||
auto modulePath = builder.get();
|
||||
return getASTContext().testImportModule(modulePath);
|
||||
}
|
||||
|
||||
bool CompilerInstance::canImportCxx() const {
|
||||
ImportPath::Module::Builder builder(
|
||||
getASTContext().getIdentifier(CXX_MODULE_NAME));
|
||||
@@ -1321,19 +1292,6 @@ ImplicitImportInfo CompilerInstance::getImplicitImportInfo() const {
|
||||
}
|
||||
}
|
||||
|
||||
if (Invocation.shouldImportSwiftBacktracing()) {
|
||||
switch (imports.StdlibKind) {
|
||||
case ImplicitStdlibKind::Builtin:
|
||||
case ImplicitStdlibKind::None:
|
||||
break;
|
||||
|
||||
case ImplicitStdlibKind::Stdlib:
|
||||
if (canImportSwiftBacktracing())
|
||||
pushImport(SWIFT_BACKTRACING_NAME);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Invocation.getLangOptions().EnableCXXInterop) {
|
||||
if (Invocation.shouldImportCxx() && canImportCxx())
|
||||
pushImport(CXX_MODULE_NAME);
|
||||
|
||||
Reference in New Issue
Block a user