Remove the -enable-union-import staging flag.

Swift SVN r25809
This commit is contained in:
Joe Groff
2015-03-06 23:08:11 +00:00
parent 20e7bdb1a9
commit b5b65b83e9
7 changed files with 9 additions and 31 deletions

View File

@@ -109,9 +109,6 @@ namespace swift {
/// it gets disabled when compiling the Swift core stdlib.
bool EnableObjCAttrRequiresFoundation = true;
/// Enables importing of unions and other partially-importable types.
bool ImportUnions = true;
/// Should access control be respected?
bool EnableAccessControl = true;

View File

@@ -181,10 +181,6 @@ def enable_private_discriminators :
Flag<["-"], "enable-private-discriminators">,
HelpText<"Mangle discriminators into the symbol names for private entities">;
def enable_union_import :
Flag<["-"], "enable-union-import">,
HelpText<"Import C unions">;
def enable_source_import : Flag<["-"], "enable-source-import">,
HelpText<"Enable importing of Swift source files">;

View File

@@ -1985,15 +1985,9 @@ namespace {
// initialized.
bool hasZeroInitializableStorage = true;
if (decl->isUnion()) {
if (Impl.SwiftContext.LangOpts.ImportUnions) {
if (decl->isUnion())
// Import the union, but don't make its storage accessible for now.
hasUnreferenceableStorage = true;
} else {
// FIXME: Skip unions for now.
return nullptr;
}
}
// FIXME: Skip Microsoft __interfaces.
if (decl->isInterface())
@@ -2028,16 +2022,9 @@ namespace {
for (auto m = decl->decls_begin(), mEnd = decl->decls_end();
m != mEnd; ++m) {
if (auto FD = dyn_cast<clang::FieldDecl>(*m))
if (FD->isBitField()) {
if (Impl.SwiftContext.LangOpts.ImportUnions) {
if (FD->isBitField())
// We don't make bitfields accessible in Swift yet.
hasUnreferenceableStorage = true;
} else {
// We don't import structs with bitfields because we can not
// lay them out correctly in IRGen.
return nullptr;
}
}
}
// Create the struct declaration and record it.

View File

@@ -612,8 +612,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
= A->getOption().matches(OPT_enable_access_control);
}
Opts.ImportUnions |= Args.hasArg(OPT_enable_union_import);
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
Opts.DebugGenericSignatures |= Args.hasArg(OPT_debug_generic_signatures);

View File

@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-union-import -parse -verify %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify %s
// XFAIL: linux

View File

@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -I %S/Inputs/abi %s -emit-ir -enable-union-import | FileCheck %s --check-prefix=CHECK-%target-cpu
// RUN: %target-swift-frontend -I %S/Inputs/abi %s -emit-ir | FileCheck %s --check-prefix=CHECK-%target-cpu
sil_stage canonical
import c_layout

View File

@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -sdk %S/Inputs -O -emit-sil -I %S/Inputs -enable-source-import -primary-file %s -enable-union-import | FileCheck %s
// RUN: %target-swift-frontend -sdk %S/Inputs -O -emit-sil -I %S/Inputs -enable-source-import -primary-file %s | FileCheck %s
import gizmo