Skip to content

Importer: remove ImportAsMember inference support #34871

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 1 commit into from
Mar 23, 2021
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
15 changes: 0 additions & 15 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,6 @@ namespace swift {
/// [TODO: Clang-type-plumbing] Turn on for feature rollout.
bool UseClangFunctionTypes = false;

/// Whether to use the import as member inference system
///
/// When importing a global, try to infer whether we can import it as a
/// member of some type instead. This includes inits, computed properties,
/// and methods.
bool InferImportAsMember = false;

/// If set to true, compile with the SIL Opaque Values enabled.
/// This is for bootstrapping. It can't be in SILOptions because the
/// TypeChecker uses it to set resolve the ParameterConvention.
Expand Down Expand Up @@ -644,13 +637,6 @@ namespace swift {
/// instead of dropped altogether when possible.
bool ImportForwardDeclarations = false;

/// Whether to use the import as member inference system
///
/// When importing a global, try to infer whether we can import it as a
/// member of some type instead. This includes inits, computed properties,
/// and methods.
bool InferImportAsMember = false;

/// If true ignore the swift bridged attribute.
bool DisableSwiftBridgeAttr = false;

Expand Down Expand Up @@ -683,7 +669,6 @@ namespace swift {
static_cast<uint8_t>(Mode),
DetailedPreprocessingRecord,
ImportForwardDeclarations,
InferImportAsMember,
DisableSwiftBridgeAttr,
DisableOverlayModules);
}
Expand Down
5 changes: 2 additions & 3 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,8 @@ def disable_conformance_availability_errors : Flag<["-"],
"disable-conformance-availability-errors">,
HelpText<"Diagnose conformance availability violations as warnings">;

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

def enable_swift3_objc_inference : Flag<["-"], "enable-swift3-objc-inference">,
Flags<[FrontendOption, HelpHidden]>,
Expand Down
1 change: 0 additions & 1 deletion lib/ClangImporter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ add_swift_host_library(swiftClangImporter STATIC
ClangModuleDependencyScanner.cpp
ClangSourceBufferImporter.cpp
DWARFImporter.cpp
IAMInference.cpp
ImportDecl.cpp
ImportEnumInfo.cpp
ImportMacro.cpp
Expand Down
7 changes: 2 additions & 5 deletions lib/ClangImporter/ClangImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//===----------------------------------------------------------------------===//
#include "swift/ClangImporter/ClangImporter.h"
#include "ClangDiagnosticConsumer.h"
#include "IAMInference.h"
#include "ImporterImpl.h"
#include "swift/AST/ASTContext.h"
#include "swift/AST/ClangModuleLoader.h"
Expand Down Expand Up @@ -1055,8 +1054,7 @@ ClangImporter::create(ASTContext &ctx,
importer->Impl.BridgingHeaderLookupTable,
importer->Impl.LookupTables, importer->Impl.SwiftContext,
importer->Impl.getBufferImporterForDiagnostics(),
importer->Impl.platformAvailability,
importer->Impl.InferImportAsMember));
importer->Impl.platformAvailability));

// Create a compiler instance.
{
Expand Down Expand Up @@ -1172,7 +1170,7 @@ ClangImporter::create(ASTContext &ctx,

importer->Impl.nameImporter.reset(new NameImporter(
importer->Impl.SwiftContext, importer->Impl.platformAvailability,
importer->Impl.getClangSema(), importer->Impl.InferImportAsMember));
importer->Impl.getClangSema()));

// FIXME: These decls are not being parsed correctly since (a) some of the
// callbacks are still being added, and (b) the logic to parse them has
Expand Down Expand Up @@ -2089,7 +2087,6 @@ ClangImporter::Implementation::Implementation(
DWARFImporterDelegate *dwarfImporterDelegate)
: SwiftContext(ctx),
ImportForwardDeclarations(ctx.ClangImporterOpts.ImportForwardDeclarations),
InferImportAsMember(ctx.ClangImporterOpts.InferImportAsMember),
DisableSwiftBridgeAttr(ctx.ClangImporterOpts.DisableSwiftBridgeAttr),
BridgingHeaderExplicitlyRequested(!ctx.ClangImporterOpts.BridgingHeader.empty()),
DisableOverlayModules(ctx.ClangImporterOpts.DisableOverlayModules),
Expand Down
Loading