Skip to content

Commit d6d9db3

Browse files
authored
Merge pull request #34871 from compnerd/noiam
Importer: remove `ImportAsMember` inference support
2 parents 168fe61 + 714eaef commit d6d9db3

File tree

17 files changed

+13
-1376
lines changed

17 files changed

+13
-1376
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,6 @@ namespace swift {
290290
/// [TODO: Clang-type-plumbing] Turn on for feature rollout.
291291
bool UseClangFunctionTypes = false;
292292

293-
/// Whether to use the import as member inference system
294-
///
295-
/// When importing a global, try to infer whether we can import it as a
296-
/// member of some type instead. This includes inits, computed properties,
297-
/// and methods.
298-
bool InferImportAsMember = false;
299-
300293
/// If set to true, compile with the SIL Opaque Values enabled.
301294
/// This is for bootstrapping. It can't be in SILOptions because the
302295
/// TypeChecker uses it to set resolve the ParameterConvention.
@@ -644,13 +637,6 @@ namespace swift {
644637
/// instead of dropped altogether when possible.
645638
bool ImportForwardDeclarations = false;
646639

647-
/// Whether to use the import as member inference system
648-
///
649-
/// When importing a global, try to infer whether we can import it as a
650-
/// member of some type instead. This includes inits, computed properties,
651-
/// and methods.
652-
bool InferImportAsMember = false;
653-
654640
/// If true ignore the swift bridged attribute.
655641
bool DisableSwiftBridgeAttr = false;
656642

@@ -683,7 +669,6 @@ namespace swift {
683669
static_cast<uint8_t>(Mode),
684670
DetailedPreprocessingRecord,
685671
ImportForwardDeclarations,
686-
InferImportAsMember,
687672
DisableSwiftBridgeAttr,
688673
DisableOverlayModules);
689674
}

include/swift/Option/FrontendOptions.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,8 @@ def disable_conformance_availability_errors : Flag<["-"],
417417
"disable-conformance-availability-errors">,
418418
HelpText<"Diagnose conformance availability violations as warnings">;
419419

420-
def enable_infer_import_as_member :
421-
Flag<["-"], "enable-infer-import-as-member">,
422-
HelpText<"Infer when a global could be imported as a member">;
420+
def report_errors_to_debugger : Flag<["-"], "report-errors-to-debugger">,
421+
HelpText<"Deprecated, will be removed in future versions.">;
423422

424423
def enable_swift3_objc_inference : Flag<["-"], "enable-swift3-objc-inference">,
425424
Flags<[FrontendOption, HelpHidden]>,

lib/ClangImporter/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ add_swift_host_library(swiftClangImporter STATIC
1414
ClangModuleDependencyScanner.cpp
1515
ClangSourceBufferImporter.cpp
1616
DWARFImporter.cpp
17-
IAMInference.cpp
1817
ImportDecl.cpp
1918
ImportEnumInfo.cpp
2019
ImportMacro.cpp

lib/ClangImporter/ClangImporter.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//===----------------------------------------------------------------------===//
1616
#include "swift/ClangImporter/ClangImporter.h"
1717
#include "ClangDiagnosticConsumer.h"
18-
#include "IAMInference.h"
1918
#include "ImporterImpl.h"
2019
#include "swift/AST/ASTContext.h"
2120
#include "swift/AST/ClangModuleLoader.h"
@@ -1055,8 +1054,7 @@ ClangImporter::create(ASTContext &ctx,
10551054
importer->Impl.BridgingHeaderLookupTable,
10561055
importer->Impl.LookupTables, importer->Impl.SwiftContext,
10571056
importer->Impl.getBufferImporterForDiagnostics(),
1058-
importer->Impl.platformAvailability,
1059-
importer->Impl.InferImportAsMember));
1057+
importer->Impl.platformAvailability));
10601058

10611059
// Create a compiler instance.
10621060
{
@@ -1172,7 +1170,7 @@ ClangImporter::create(ASTContext &ctx,
11721170

11731171
importer->Impl.nameImporter.reset(new NameImporter(
11741172
importer->Impl.SwiftContext, importer->Impl.platformAvailability,
1175-
importer->Impl.getClangSema(), importer->Impl.InferImportAsMember));
1173+
importer->Impl.getClangSema()));
11761174

11771175
// FIXME: These decls are not being parsed correctly since (a) some of the
11781176
// callbacks are still being added, and (b) the logic to parse them has
@@ -2083,7 +2081,6 @@ ClangImporter::Implementation::Implementation(
20832081
DWARFImporterDelegate *dwarfImporterDelegate)
20842082
: SwiftContext(ctx),
20852083
ImportForwardDeclarations(ctx.ClangImporterOpts.ImportForwardDeclarations),
2086-
InferImportAsMember(ctx.ClangImporterOpts.InferImportAsMember),
20872084
DisableSwiftBridgeAttr(ctx.ClangImporterOpts.DisableSwiftBridgeAttr),
20882085
BridgingHeaderExplicitlyRequested(!ctx.ClangImporterOpts.BridgingHeader.empty()),
20892086
DisableOverlayModules(ctx.ClangImporterOpts.DisableOverlayModules),

0 commit comments

Comments
 (0)