Skip to content

Commit 0918edc

Browse files
committed
Add EnableImportPtrauthFieldFunctionPointers flag
1 parent 2f8751c commit 0918edc

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

include/swift/AST/SILOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ class SILOptions {
135135
/// temporaries for stack protection.
136136
bool EnableMoveInoutStackProtection = false;
137137

138+
/// Enables codegen support for clang imported ptrauth qualified field
139+
/// function pointers.
140+
bool EnableImportPtrauthFieldFunctionPointers = false;
141+
138142
/// Controls whether or not paranoid verification checks are run.
139143
bool VerifyAll = false;
140144

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,10 @@ def enable_move_inout_stack_protector :
11121112
Flag<["-"], "enable-move-inout-stack-protector">,
11131113
HelpText<"Enable the stack protector by moving values to temporaries">;
11141114

1115+
def enable_import_ptrauth_field_function_pointers :
1116+
Flag<["-"], "enable-import-ptrauth-field-function-pointers">,
1117+
HelpText<"Enable import of custom ptrauth qualified field function pointers">;
1118+
11151119
def enable_collocate_metadata_functions :
11161120
Flag<["-"], "enable-collocate-metadata-functions">,
11171121
HelpText<"Enable collocate metadata functions">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,9 +1823,11 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
18231823
Opts.EnableStackProtection =
18241824
Args.hasFlag(OPT_enable_stack_protector, OPT_disable_stack_protector,
18251825
Opts.EnableStackProtection);
1826-
Opts.EnableMoveInoutStackProtection =
1827-
Args.hasFlag(OPT_enable_move_inout_stack_protector, OPT_disable_stack_protector,
1828-
Opts.EnableMoveInoutStackProtection);
1826+
Opts.EnableMoveInoutStackProtection = Args.hasArg(
1827+
OPT_enable_move_inout_stack_protector, OPT_disable_stack_protector,
1828+
Opts.EnableMoveInoutStackProtection);
1829+
Opts.EnableImportPtrauthFieldFunctionPointers =
1830+
Args.hasArg(OPT_enable_import_ptrauth_field_function_pointers);
18291831
Opts.VerifyAll |= Args.hasArg(OPT_sil_verify_all);
18301832
Opts.VerifyNone |= Args.hasArg(OPT_sil_verify_none);
18311833
Opts.DebugSerialization |= Args.hasArg(OPT_sil_debug_serialization);

0 commit comments

Comments
 (0)