Skip to content

Commit 09580fc

Browse files
committed
Enable importing ptrauth qualified function pointers from c by default
rdar://109235426
1 parent 07eb52a commit 09580fc

6 files changed

+6
-11
lines changed

include/swift/Option/FrontendOptions.td

-3
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,6 @@ def enable_move_inout_stack_protector :
12251225
Flag<["-"], "enable-move-inout-stack-protector">,
12261226
HelpText<"Enable the stack protector by moving values to temporaries">;
12271227

1228-
def enable_import_ptrauth_field_function_pointers :
1229-
Flag<["-"], "enable-import-ptrauth-field-function-pointers">,
1230-
HelpText<"Enable import of custom ptrauth qualified field function pointers">;
12311228
def disable_import_ptrauth_field_function_pointers :
12321229
Flag<["-"], "disable-import-ptrauth-field-function-pointers">,
12331230
HelpText<"Disable import of custom ptrauth qualified field function pointers">;

lib/Frontend/CompilerInvocation.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -2416,9 +2416,7 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
24162416
OPT_enable_move_inout_stack_protector, OPT_disable_stack_protector,
24172417
Opts.EnableMoveInoutStackProtection);
24182418
Opts.EnableImportPtrauthFieldFunctionPointers =
2419-
Args.hasArg(OPT_enable_import_ptrauth_field_function_pointers,
2420-
OPT_disable_import_ptrauth_field_function_pointers,
2421-
Opts.EnableImportPtrauthFieldFunctionPointers);
2419+
!Args.hasArg(OPT_disable_import_ptrauth_field_function_pointers);
24222420
Opts.EnableLifetimeDependenceDiagnostics =
24232421
Args.hasFlag(OPT_enable_lifetime_dependence_diagnostics,
24242422
OPT_disable_lifetime_dependence_diagnostics,

test/IRGen/ptrauth_field_fptr_import.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swift-frontend %s -enable-import-ptrauth-field-function-pointers -emit-ir -target arm64e-apple-ios13.0 -I %S/Inputs/ -validate-tbd-against-ir=none -Xllvm -sil-disable-pass=OnoneSimplification | %FileCheck %s
1+
// RUN: %swift-frontend %s -emit-ir -target arm64e-apple-ios13.0 -I %S/Inputs/ -validate-tbd-against-ir=none -Xllvm -sil-disable-pass=OnoneSimplification | %FileCheck %s
22
// REQUIRES: CPU=arm64e
33
// REQUIRES: OS=ios
44

test/SILGen/ptrauth_field_fptr_import.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swift-frontend %s -enable-import-ptrauth-field-function-pointers -emit-silgen -target arm64e-apple-ios13.0 -I %S/Inputs/ | %FileCheck %s
1+
// RUN: %swift-frontend %s -emit-silgen -target arm64e-apple-ios13.0 -I %S/Inputs/ | %FileCheck %s
22

33
// REQUIRES: CPU=arm64e
44
// REQUIRES: OS=ios

test/embedded/ptrauth-fieldptr1.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %{python} %utils/split_file.py -o %t %s
33

4-
// RUN: %target-swift-frontend -enable-import-ptrauth-field-function-pointers -O -emit-ir %t/Main.swift -enable-experimental-feature Embedded -import-objc-header %t/header.h | %FileCheck %s
4+
// RUN: %target-swift-frontend -O -emit-ir %t/Main.swift -enable-experimental-feature Embedded -import-objc-header %t/header.h | %FileCheck %s
55

66
// REQUIRES: swift_in_compiler
77
// REQUIRES: OS=macosx || OS=linux-gnu

test/embedded/ptrauth-fieldptr2.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %{python} %utils/split_file.py -o %t %s
33

4-
// RUN: %target-swift-frontend -enable-import-ptrauth-field-function-pointers -O -emit-module -o %t/Module.swiftmodule %t/Module.swift -enable-experimental-feature Embedded -import-objc-header %t/header.h
4+
// RUN: %target-swift-frontend -O -emit-module -o %t/Module.swiftmodule %t/Module.swift -enable-experimental-feature Embedded -import-objc-header %t/header.h
55

6-
// RUN: %target-swift-frontend -enable-import-ptrauth-field-function-pointers -O -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded -import-objc-header %t/header.h
6+
// RUN: %target-swift-frontend -O -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded -import-objc-header %t/header.h
77

88
// REQUIRES: swift_in_compiler
99
// REQUIRES: OS=macosx || OS=linux-gnu

0 commit comments

Comments
 (0)