Skip to content

Commit c0b432d

Browse files
committed
[Omit needless words] Always dump both argument label and parameter name.
The default first argument label rules are confusing reviewers looking at API dumps. Even though it's more verbose, always put in argument labels explicitly.
1 parent 5063c21 commit c0b432d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ SkipParameterNames("skip-parameter-names",
258258
llvm::cl::desc("Whether to skip parameter names"),
259259
llvm::cl::init(false));
260260

261+
static llvm::cl::opt<bool>
262+
AlwaysArgumentLabels("always-argument-labels",
263+
llvm::cl::desc("Whether to always print separate argument labels"),
264+
llvm::cl::init(false));
265+
261266
static llvm::cl::opt<bool>
262267
DisableAccessControl("disable-access-control",
263268
llvm::cl::desc("Disables access control, like a debugger"));
@@ -2571,6 +2576,9 @@ int main(int argc, char *argv[]) {
25712576
if (options::SkipParameterNames) {
25722577
PrintOpts.ArgAndParamPrinting
25732578
= PrintOptions::ArgAndParamPrintingMode::ArgumentOnly;
2579+
} else if (options::AlwaysArgumentLabels) {
2580+
PrintOpts.ArgAndParamPrinting
2581+
= PrintOptions::ArgAndParamPrintingMode::BothAlways;
25742582
}
25752583
}
25762584
if (options::SkipUnderscoredStdlibProtocols)

utils/swift-api-dump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def main():
229229
parser = create_parser()
230230
args = parser.parse_args()
231231

232-
cmd_common = [args.swift_ide_test, '-print-module', '-source-filename', source_filename, '-module-print-skip-overlay', '-skip-unavailable', '-skip-print-doc-comments']
232+
cmd_common = [args.swift_ide_test, '-print-module', '-source-filename', source_filename, '-module-print-skip-overlay', '-skip-unavailable', '-skip-print-doc-comments', '-always-argument-labels']
233233

234234
# Add -F / -I arguments.
235235
if args.framework_dir:

0 commit comments

Comments
 (0)