mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove the -enable-union-import staging flag.
Swift SVN r25809
This commit is contained in:
@@ -109,9 +109,6 @@ namespace swift {
|
|||||||
/// it gets disabled when compiling the Swift core stdlib.
|
/// it gets disabled when compiling the Swift core stdlib.
|
||||||
bool EnableObjCAttrRequiresFoundation = true;
|
bool EnableObjCAttrRequiresFoundation = true;
|
||||||
|
|
||||||
/// Enables importing of unions and other partially-importable types.
|
|
||||||
bool ImportUnions = true;
|
|
||||||
|
|
||||||
/// Should access control be respected?
|
/// Should access control be respected?
|
||||||
bool EnableAccessControl = true;
|
bool EnableAccessControl = true;
|
||||||
|
|
||||||
|
|||||||
@@ -181,10 +181,6 @@ def enable_private_discriminators :
|
|||||||
Flag<["-"], "enable-private-discriminators">,
|
Flag<["-"], "enable-private-discriminators">,
|
||||||
HelpText<"Mangle discriminators into the symbol names for private entities">;
|
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">,
|
def enable_source_import : Flag<["-"], "enable-source-import">,
|
||||||
HelpText<"Enable importing of Swift source files">;
|
HelpText<"Enable importing of Swift source files">;
|
||||||
|
|
||||||
|
|||||||
@@ -1985,15 +1985,9 @@ namespace {
|
|||||||
// initialized.
|
// initialized.
|
||||||
bool hasZeroInitializableStorage = true;
|
bool hasZeroInitializableStorage = true;
|
||||||
|
|
||||||
if (decl->isUnion()) {
|
if (decl->isUnion())
|
||||||
if (Impl.SwiftContext.LangOpts.ImportUnions) {
|
// Import the union, but don't make its storage accessible for now.
|
||||||
// Import the union, but don't make its storage accessible for now.
|
hasUnreferenceableStorage = true;
|
||||||
hasUnreferenceableStorage = true;
|
|
||||||
} else {
|
|
||||||
// FIXME: Skip unions for now.
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: Skip Microsoft __interfaces.
|
// FIXME: Skip Microsoft __interfaces.
|
||||||
if (decl->isInterface())
|
if (decl->isInterface())
|
||||||
@@ -2028,16 +2022,9 @@ namespace {
|
|||||||
for (auto m = decl->decls_begin(), mEnd = decl->decls_end();
|
for (auto m = decl->decls_begin(), mEnd = decl->decls_end();
|
||||||
m != mEnd; ++m) {
|
m != mEnd; ++m) {
|
||||||
if (auto FD = dyn_cast<clang::FieldDecl>(*m))
|
if (auto FD = dyn_cast<clang::FieldDecl>(*m))
|
||||||
if (FD->isBitField()) {
|
if (FD->isBitField())
|
||||||
if (Impl.SwiftContext.LangOpts.ImportUnions) {
|
// We don't make bitfields accessible in Swift yet.
|
||||||
// We don't make bitfields accessible in Swift yet.
|
hasUnreferenceableStorage = true;
|
||||||
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.
|
// Create the struct declaration and record it.
|
||||||
|
|||||||
@@ -612,8 +612,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
|||||||
= A->getOption().matches(OPT_enable_access_control);
|
= A->getOption().matches(OPT_enable_access_control);
|
||||||
}
|
}
|
||||||
|
|
||||||
Opts.ImportUnions |= Args.hasArg(OPT_enable_union_import);
|
|
||||||
|
|
||||||
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
|
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
|
||||||
Opts.DebugGenericSignatures |= Args.hasArg(OPT_debug_generic_signatures);
|
Opts.DebugGenericSignatures |= Args.hasArg(OPT_debug_generic_signatures);
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
// XFAIL: linux
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
sil_stage canonical
|
||||||
import c_layout
|
import c_layout
|
||||||
|
|||||||
@@ -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
|
import gizmo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user