mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ClangImporter: Remove -enable-c-function-pointers staging option.
Swift SVN r29764
This commit is contained in:
@@ -77,9 +77,6 @@ namespace swift {
|
|||||||
/// symbols as optionals.
|
/// symbols as optionals.
|
||||||
bool EnableExperimentalUnavailableAsOptional = false;
|
bool EnableExperimentalUnavailableAsOptional = false;
|
||||||
|
|
||||||
/// \brief Enable support for native C function pointer types.
|
|
||||||
bool EnableCFunctionPointers = true;
|
|
||||||
|
|
||||||
/// \brief Enable support for SIMD type imports.
|
/// \brief Enable support for SIMD type imports.
|
||||||
bool EnableSIMDImport = true;
|
bool EnableSIMDImport = true;
|
||||||
|
|
||||||
|
|||||||
@@ -195,10 +195,6 @@ def enable_availability_checking_in_implicit_functions : Flag<["-"],
|
|||||||
"enable-availability-checking-in-implicit-functions">,
|
"enable-availability-checking-in-implicit-functions">,
|
||||||
HelpText<"Enable checking availability in implicit functions">;
|
HelpText<"Enable checking availability in implicit functions">;
|
||||||
|
|
||||||
def enable_c_function_pointers : Flag<["-"],
|
|
||||||
"enable-c-function-pointers">,
|
|
||||||
HelpText<"Enable native C function pointer types">;
|
|
||||||
|
|
||||||
def enable_simd_import : Flag<["-"],
|
def enable_simd_import : Flag<["-"],
|
||||||
"enable-simd-import">,
|
"enable-simd-import">,
|
||||||
HelpText<"Enable importing C vector types as SIMD types">;
|
HelpText<"Enable importing C vector types as SIMD types">;
|
||||||
|
|||||||
@@ -326,19 +326,13 @@ namespace {
|
|||||||
return getOpaquePointerType();
|
return getOpaquePointerType();
|
||||||
|
|
||||||
if (pointeeQualType->isFunctionType()) {
|
if (pointeeQualType->isFunctionType()) {
|
||||||
if (Impl.SwiftContext.LangOpts.EnableCFunctionPointers) {
|
auto funcTy = pointeeType->castTo<FunctionType>();
|
||||||
auto funcTy = pointeeType->castTo<FunctionType>();
|
return {
|
||||||
return {
|
FunctionType::get(funcTy->getInput(), funcTy->getResult(),
|
||||||
FunctionType::get(funcTy->getInput(), funcTy->getResult(),
|
funcTy->getExtInfo().withRepresentation(
|
||||||
funcTy->getExtInfo().withRepresentation(
|
AnyFunctionType::Representation::CFunctionPointer)),
|
||||||
AnyFunctionType::Representation::CFunctionPointer)),
|
ImportHint::CFunctionPointer
|
||||||
ImportHint::CFunctionPointer
|
};
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return Impl.getNamedSwiftTypeSpecialization(Impl.getStdlibModule(),
|
|
||||||
"CFunctionPointer",
|
|
||||||
pointeeType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto quals = pointeeQualType.getQualifiers();
|
auto quals = pointeeQualType.getQualifiers();
|
||||||
|
|||||||
@@ -638,9 +638,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
|||||||
Opts.EnableExperimentalUnavailableAsOptional |=
|
Opts.EnableExperimentalUnavailableAsOptional |=
|
||||||
Args.hasArg(OPT_enable_experimental_unavailable_as_optional);
|
Args.hasArg(OPT_enable_experimental_unavailable_as_optional);
|
||||||
|
|
||||||
Opts.EnableCFunctionPointers |=
|
|
||||||
Args.hasArg(OPT_enable_c_function_pointers);
|
|
||||||
|
|
||||||
Opts.EnableSIMDImport |=
|
Opts.EnableSIMDImport |=
|
||||||
Args.hasArg(OPT_enable_simd_import);
|
Args.hasArg(OPT_enable_simd_import);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// RUN: rm -rf %t && mkdir %t
|
// RUN: rm -rf %t && mkdir %t
|
||||||
// RUN: %target-build-swift %s -Xfrontend -enable-c-function-pointers -o %t/a.out
|
// RUN: %target-build-swift %s -o %t/a.out
|
||||||
// RUN: %target-run %t/a.out | FileCheck %s
|
// RUN: %target-run %t/a.out | FileCheck %s
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// RUN: %target-swift-frontend -parse -verify -module-name main -enable-c-function-pointers %s
|
// RUN: %target-swift-frontend -parse -verify -module-name main %s
|
||||||
func global() -> Int { return 0 }
|
func global() -> Int { return 0 }
|
||||||
|
|
||||||
struct S {
|
struct S {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// RUN: %target-swift-frontend -emit-silgen -enable-c-function-pointers %s | FileCheck %s
|
// RUN: %target-swift-frontend -emit-silgen %s | FileCheck %s
|
||||||
|
|
||||||
func values(arg: @convention(c) Int -> Int) -> @convention(c) Int -> Int {
|
func values(arg: @convention(c) Int -> Int) -> @convention(c) Int -> Int {
|
||||||
return arg
|
return arg
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// RUN: %target-swift-frontend -verify -enable-c-function-pointers -emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import -disable-objc-attr-requires-foundation-module %s | FileCheck %s
|
// RUN: %target-swift-frontend -verify -emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import -disable-objc-attr-requires-foundation-module %s | FileCheck %s
|
||||||
|
|
||||||
// REQUIRES: objc_interop
|
// REQUIRES: objc_interop
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user