Skip to content

Commit d347ffa

Browse files
committed
Correct access notes flag spelling and add to driver
1 parent af55bbc commit d347ffa

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ def supplementary_output_file_map : Separate<["-"], "supplementary-output-file-m
3333
def frontend_parseable_output : Flag<["-"], "frontend-parseable-output">,
3434
HelpText<"Emit textual output in a parseable format">;
3535

36-
def access_notes : Separate<["-"], "access-notes">, MetaVarName<"<path>">,
37-
HelpText<"Specify YAML file to override attributes on Swift declarations in this module">;
38-
3936
def emit_module_doc : Flag<["-"], "emit-module-doc">,
4037
HelpText<"Emit a module documentation file based on documentation "
4138
"comments">;

include/swift/Option/Options.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,13 @@ def lto : Joined<["-"], "lto=">,
525525
Flags<[FrontendOption, NoInteractiveOption]>,
526526
HelpText<"Specify the LTO type to either 'llvm-thin' or 'llvm-full'">;
527527

528+
def access_notes_path : Separate<["-"], "access-notes-path">,
529+
Flags<[FrontendOption, ArgumentIsPath]>,
530+
HelpText<"Specify YAML file to override attributes on Swift declarations in this module">;
531+
def access_notes_path_EQ : Joined<["-"], "access-notes-path=">,
532+
Flags<[FrontendOption, ArgumentIsPath]>,
533+
Alias<access_notes_path>;
534+
528535
// Experimental feature options
529536

530537
// Note: this flag will be removed when JVP/differential generation in the

lib/Driver/ToolChains.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI,
278278
options::OPT_disable_fuzzy_forward_scan_trailing_closure_matching);
279279
inputArgs.AddLastArg(arguments,
280280
options::OPT_verify_incremental_dependencies);
281+
inputArgs.AddLastArg(arguments, options::OPT_access_notes_path);
281282

282283
// Pass on any build config options
283284
inputArgs.AddAllArgs(arguments, options::OPT_D);

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ bool ArgsToFrontendOptionsConverter::convert(
216216
if (const Arg *A = Args.getLastArg(OPT_module_link_name))
217217
Opts.ModuleLinkName = A->getValue();
218218

219-
if (const Arg *A = Args.getLastArg(OPT_access_notes))
219+
if (const Arg *A = Args.getLastArg(OPT_access_notes_path))
220220
Opts.AccessNotesPath = A->getValue();
221221

222222
if (const Arg *A = Args.getLastArg(OPT_serialize_debugging_options,

test/Driver/access-notes.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %swiftc_driver -emit-executable -o %t.exe %s -access-notes-path %S/Inputs/missing.accessnotes -### 2>&1 | %FileCheck %s
2+
3+
// CHECK: -access-notes-path SOURCE_DIR/test/Driver/Inputs/missing.accessnotes

test/SILGen/objc_access_notes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// RUN: %target-swift-emit-silgen -module-name objc_thunks -Xllvm -sil-full-demangle -Xllvm -sil-print-debuginfo -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -emit-verbose-sil -swift-version 5 -access-notes %S/Inputs/objc_access_notes.accessnotes -verify | %FileCheck %s
2+
// RUN: %target-swift-emit-silgen -module-name objc_thunks -Xllvm -sil-full-demangle -Xllvm -sil-print-debuginfo -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -emit-verbose-sil -swift-version 5 -access-notes-path %S/Inputs/objc_access_notes.accessnotes -verify | %FileCheck %s
33

44
// Verify that the access notes are necessary for the test to pass.
55
// RUN-X: not %target-swift-emit-silgen -module-name objc_thunks -Xllvm -sil-full-demangle -Xllvm -sil-print-debuginfo -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -emit-verbose-sil -swift-version 5 | %FileCheck %s

0 commit comments

Comments
 (0)