Skip to content

Commit 6c7dfa6

Browse files
all supplementary outputs affect incremental builds
rdar://75536036
1 parent cbd0206 commit 6c7dfa6

File tree

3 files changed

+47
-37
lines changed

3 files changed

+47
-37
lines changed

include/swift/Option/Options.td

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ def profile_stats_entities: Flag<["-"], "profile-stats-entities">,
300300
HelpText<"Profile changes to stats in -stats-output-dir, subdivided by source entity">;
301301

302302
def emit_dependencies : Flag<["-"], "emit-dependencies">,
303-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
304-
SupplementaryOutput]>,
303+
Flags<[FrontendOption, NoInteractiveOption, SupplementaryOutput]>,
305304
HelpText<"Emit basic Make-compatible dependencies files">;
306305
def track_system_dependencies : Flag<["-"], "track-system-dependencies">,
307306
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>,
@@ -344,17 +343,14 @@ def embed_tbd_for_module : Separate<["-"], "embed-tbd-for-module">,
344343
HelpText<"Embed symbols from the module in the emitted tbd file">;
345344

346345
def serialize_diagnostics : Flag<["-"], "serialize-diagnostics">,
347-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
348-
SupplementaryOutput]>,
346+
Flags<[FrontendOption, NoInteractiveOption, SupplementaryOutput]>,
349347
HelpText<"Serialize diagnostics in a binary format">;
350348
def serialize_diagnostics_path : Separate<["-"], "serialize-diagnostics-path">,
351-
Flags<[FrontendOption, NoBatchOption, DoesNotAffectIncrementalBuild,
352-
ArgumentIsPath, SupplementaryOutput]>,
349+
Flags<[FrontendOption, NoBatchOption, ArgumentIsPath, SupplementaryOutput]>,
353350
HelpText<"Emit a serialized diagnostics file to <path>">,
354351
MetaVarName<"<path>">;
355352
def serialize_diagnostics_path_EQ: Joined<["-"], "serialize-diagnostics-path=">,
356-
Flags<[FrontendOption, NoBatchOption, DoesNotAffectIncrementalBuild,
357-
ArgumentIsPath, SupplementaryOutput]>,
353+
Flags<[FrontendOption, NoBatchOption, ArgumentIsPath, SupplementaryOutput]>,
358354
Alias<serialize_diagnostics_path>;
359355
def color_diagnostics : Flag<["-"], "color-diagnostics">,
360356
Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>,
@@ -426,45 +422,42 @@ def module_abi_name : Separate<["-"], "module-abi-name">,
426422
HelpText<"ABI name to use for the contents of this module">;
427423

428424
def emit_module : Flag<["-"], "emit-module">,
429-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
430-
SupplementaryOutput]>,
425+
Flags<[FrontendOption, NoInteractiveOption, SupplementaryOutput]>,
431426
HelpText<"Emit an importable module">;
432427
def emit_module_path : Separate<["-"], "emit-module-path">,
433-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
434-
ArgumentIsPath, SupplementaryOutput]>,
428+
Flags<[FrontendOption, NoInteractiveOption, ArgumentIsPath,
429+
SupplementaryOutput]>,
435430
HelpText<"Emit an importable module to <path>">,
436431
MetaVarName<"<path>">;
437432
def emit_module_path_EQ : Joined<["-"], "emit-module-path=">,
438-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
439-
ArgumentIsPath, SupplementaryOutput]>,
433+
Flags<[FrontendOption, NoInteractiveOption, ArgumentIsPath,
434+
SupplementaryOutput]>,
440435
Alias<emit_module_path>;
441436

442437
def emit_module_summary :
443438
Flag<["-"], "emit-module-summary">,
444-
Flags<[NoInteractiveOption, DoesNotAffectIncrementalBuild,
445-
SupplementaryOutput]>,
439+
Flags<[NoInteractiveOption, SupplementaryOutput]>,
446440
HelpText<"Output module summary file">;
447441
def emit_module_summary_path :
448442
Separate<["-"], "emit-module-summary-path">,
449-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
450-
ArgumentIsPath, SupplementaryOutput]>,
443+
Flags<[FrontendOption, NoInteractiveOption, ArgumentIsPath,
444+
SupplementaryOutput]>,
451445
MetaVarName<"<path>">, HelpText<"Output module summary file to <path>">;
452446

453447
def emit_module_interface :
454448
Flag<["-"], "emit-module-interface">,
455-
Flags<[NoInteractiveOption, DoesNotAffectIncrementalBuild,
456-
SupplementaryOutput]>,
449+
Flags<[NoInteractiveOption, SupplementaryOutput]>,
457450
HelpText<"Output module interface file">;
458451
def emit_module_interface_path :
459452
Separate<["-"], "emit-module-interface-path">,
460-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
461-
ArgumentIsPath, SupplementaryOutput]>,
453+
Flags<[FrontendOption, NoInteractiveOption, ArgumentIsPath,
454+
SupplementaryOutput]>,
462455
MetaVarName<"<path>">, HelpText<"Output module interface file to <path>">;
463456

464457
def emit_private_module_interface_path :
465458
Separate<["-"], "emit-private-module-interface-path">,
466459
Flags<[FrontendOption, NoInteractiveOption, HelpHidden,
467-
DoesNotAffectIncrementalBuild, ArgumentIsPath, SupplementaryOutput]>,
460+
ArgumentIsPath, SupplementaryOutput]>,
468461
MetaVarName<"<path>">, HelpText<"Output private module interface file to <path>">;
469462

470463
def verify_emitted_module_interface :
@@ -483,28 +476,26 @@ def avoid_emit_module_source_info :
483476

484477
def emit_module_source_info_path :
485478
Separate<["-"], "emit-module-source-info-path">,
486-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
487-
ArgumentIsPath, SupplementaryOutput]>,
479+
Flags<[FrontendOption, NoInteractiveOption, ArgumentIsPath,
480+
SupplementaryOutput]>,
488481
MetaVarName<"<path>">, HelpText<"Output module source info file to <path>">;
489482

490483
def emit_parseable_module_interface :
491484
Flag<["-"], "emit-parseable-module-interface">,
492485
Alias<emit_module_interface>,
493-
Flags<[NoInteractiveOption, HelpHidden, DoesNotAffectIncrementalBuild,
494-
SupplementaryOutput]>;
486+
Flags<[NoInteractiveOption, HelpHidden, SupplementaryOutput]>;
495487
def emit_parseable_module_interface_path :
496488
Separate<["-"], "emit-parseable-module-interface-path">,
497489
Alias<emit_module_interface_path>,
498-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
499-
HelpHidden, ArgumentIsPath, SupplementaryOutput]>;
490+
Flags<[FrontendOption, NoInteractiveOption, HelpHidden, ArgumentIsPath,
491+
SupplementaryOutput]>;
500492

501493
def emit_objc_header : Flag<["-"], "emit-objc-header">,
502-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
503-
SupplementaryOutput]>,
494+
Flags<[FrontendOption, NoInteractiveOption, SupplementaryOutput]>,
504495
HelpText<"Emit an Objective-C header file">;
505496
def emit_objc_header_path : Separate<["-"], "emit-objc-header-path">,
506-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
507-
ArgumentIsPath, SupplementaryOutput]>,
497+
Flags<[FrontendOption, NoInteractiveOption, ArgumentIsPath,
498+
SupplementaryOutput]>,
508499
MetaVarName<"<path>">, HelpText<"Emit an Objective-C header file to <path>">;
509500

510501
def static : Flag<["-"], "static">,
@@ -1191,13 +1182,12 @@ def disable_autolinking_runtime_compatibility_dynamic_replacements
11911182
"compatibility library">;
11921183

11931184
def emit_symbol_graph: Flag<["-"], "emit-symbol-graph">,
1194-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
1195-
SupplementaryOutput, HelpHidden]>,
1185+
Flags<[FrontendOption, NoInteractiveOption, SupplementaryOutput, HelpHidden]>,
11961186
HelpText<"Emit a symbol graph">;
11971187

11981188
def emit_symbol_graph_dir : Separate<["-"], "emit-symbol-graph-dir">,
1199-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild,
1200-
ArgumentIsPath, SupplementaryOutput, HelpHidden]>,
1189+
Flags<[FrontendOption, NoInteractiveOption, ArgumentIsPath,
1190+
SupplementaryOutput, HelpHidden]>,
12011191
HelpText<"Emit a symbol graph to directory <dir>">,
12021192
MetaVarName<"<dir>">;
12031193

test/SymbolGraph/EmitWhileBuilding.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
// RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t -driver-filelist-threshold=0 -O -whole-module-optimization
1616
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
1717

18+
// also try with an up-to-date incremental build to make sure that adding the symbol graph flags
19+
// can get them to be generated
20+
21+
// RUN: %empty-directory(%t)
22+
// RUN: cp %s %t
23+
// RUN: cd %t && %target-build-swift %t/EmitWhileBuilding.swift -module-name EmitWhileBuilding -c -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-dependencies -incremental -output-file-map=%S/Inputs/EmitWhileBuilding.output.json -working-directory %t -v -driver-show-incremental
24+
// RUN: cd %t && %target-build-swift %t/EmitWhileBuilding.swift -module-name EmitWhileBuilding -c -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-dependencies -incremental -output-file-map=%S/Inputs/EmitWhileBuilding.output.json -working-directory %t -v -driver-show-incremental -emit-symbol-graph -emit-symbol-graph-dir %t
25+
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
26+
1827
/// Does a foo.
1928
public func foo() {}
2029

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"": {
3+
"swift-dependencies": "./EmitWhileBuilding-main.swiftdeps"
4+
},
5+
"EmitWhileBuilding.swift": {
6+
"object": "./EmitWhileBuilding.o",
7+
"swiftmodule": "./EmitWhileBuilding.swiftmodule",
8+
"dependencies": "./EmitWhileBuilding.d",
9+
"swift-dependencies": "./EmitWhileBuilding.swiftdeps"
10+
}
11+
}

0 commit comments

Comments
 (0)