Skip to content

Commit dd2bdfe

Browse files
committed
Importer: remove ImportAsMember support
This functionality is not actively in use and the last usage of this has been removed. Remove the infrastructure that is no longer in need.
1 parent 887464b commit dd2bdfe

File tree

17 files changed

+10
-1377
lines changed

17 files changed

+10
-1377
lines changed

include/swift/Basic/LangOptions.h

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

279-
/// Whether to use the import as member inference system
280-
///
281-
/// When importing a global, try to infer whether we can import it as a
282-
/// member of some type instead. This includes inits, computed properties,
283-
/// and methods.
284-
bool InferImportAsMember = false;
285-
286279
/// If set to true, compile with the SIL Opaque Values enabled.
287280
/// This is for bootstrapping. It can't be in SILOptions because the
288281
/// TypeChecker uses it to set resolve the ParameterConvention.
@@ -613,13 +606,6 @@ namespace swift {
613606
/// instead of dropped altogether when possible.
614607
bool ImportForwardDeclarations = false;
615608

616-
/// Whether to use the import as member inference system
617-
///
618-
/// When importing a global, try to infer whether we can import it as a
619-
/// member of some type instead. This includes inits, computed properties,
620-
/// and methods.
621-
bool InferImportAsMember = false;
622-
623609
/// If true ignore the swift bridged attribute.
624610
bool DisableSwiftBridgeAttr = false;
625611

@@ -652,7 +638,6 @@ namespace swift {
652638
static_cast<uint8_t>(Mode),
653639
DetailedPreprocessingRecord,
654640
ImportForwardDeclarations,
655-
InferImportAsMember,
656641
DisableSwiftBridgeAttr,
657642
DisableOverlayModules);
658643
}

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,6 @@ def disable_conformance_availability_errors : Flag<["-"],
420420
def report_errors_to_debugger : Flag<["-"], "report-errors-to-debugger">,
421421
HelpText<"Deprecated, will be removed in future versions.">;
422422

423-
def enable_infer_import_as_member :
424-
Flag<["-"], "enable-infer-import-as-member">,
425-
HelpText<"Infer when a global could be imported as a member">;
426-
427423
def enable_swift3_objc_inference : Flag<["-"], "enable-swift3-objc-inference">,
428424
Flags<[FrontendOption, HelpHidden]>,
429425
HelpText<"Enable Swift 3's @objc inference rules for NSObject-derived classes and 'dynamic' members (emulates Swift 3 behavior)">;

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"
@@ -1027,8 +1026,7 @@ ClangImporter::create(ASTContext &ctx,
10271026
importer->Impl.BridgingHeaderLookupTable,
10281027
importer->Impl.LookupTables, importer->Impl.SwiftContext,
10291028
importer->Impl.getBufferImporterForDiagnostics(),
1030-
importer->Impl.platformAvailability,
1031-
importer->Impl.InferImportAsMember));
1029+
importer->Impl.platformAvailability));
10321030

10331031
// Create a compiler instance.
10341032
{
@@ -1144,7 +1142,7 @@ ClangImporter::create(ASTContext &ctx,
11441142

11451143
importer->Impl.nameImporter.reset(new NameImporter(
11461144
importer->Impl.SwiftContext, importer->Impl.platformAvailability,
1147-
importer->Impl.getClangSema(), importer->Impl.InferImportAsMember));
1145+
importer->Impl.getClangSema()));
11481146

11491147
// FIXME: These decls are not being parsed correctly since (a) some of the
11501148
// callbacks are still being added, and (b) the logic to parse them has
@@ -2033,7 +2031,6 @@ ClangImporter::Implementation::Implementation(
20332031
DWARFImporterDelegate *dwarfImporterDelegate)
20342032
: SwiftContext(ctx),
20352033
ImportForwardDeclarations(ctx.ClangImporterOpts.ImportForwardDeclarations),
2036-
InferImportAsMember(ctx.ClangImporterOpts.InferImportAsMember),
20372034
DisableSwiftBridgeAttr(ctx.ClangImporterOpts.DisableSwiftBridgeAttr),
20382035
BridgingHeaderExplicitlyRequested(!ctx.ClangImporterOpts.BridgingHeader.empty()),
20392036
DisableOverlayModules(ctx.ClangImporterOpts.DisableOverlayModules),

0 commit comments

Comments
 (0)