Add -coverage-prefix-map arg#128
Conversation
| self.numParallelJobs = Self.determineNumParallelJobs(&parsedOptions, diagnosticsEngine: diagnosticEngine, env: env) | ||
|
|
||
| try Self.validateWarningControlArgs(&parsedOptions) | ||
| Self.validateCoverageArgs(&parsedOptions, diagnosticsEngine: diagnosticEngine) |
There was a problem hiding this comment.
I didn't love creating a new function for this but there wasn't another obvious place to put it
There was a problem hiding this comment.
Your comment made me think about an alternative approach. validateCoverageArgs could be parseCoverageArgs that parses the args, diagnoses failures, and then returns an array of (original, remapped) pairs. Then, we render that array to arguments in addCommonFrontendOptions. What you do you think about that approach?
There was a problem hiding this comment.
(I'm open to make any changes like that) Gut feeling is it might not be worth adding that much processing to these options considering we don't even handle them, it feels like it could increase the surface area for bugs around this
There was a problem hiding this comment.
Sure. I'm fine with treating this as a "validate" call like you have it, but wanted to float the idea in case you preferred this alternative design. I don't feel strongly about it.
| public static let colorDiagnostics: Option = Option("-color-diagnostics", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Print diagnostics in color") | ||
| public static let compileModuleFromInterface: Option = Option("-compile-module-from-interface", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Treat the (single) input as a swiftinterface and produce a module", group: .modes) | ||
| public static let continueBuildingAfterErrors: Option = Option("-continue-building-after-errors", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Continue building, even after errors are encountered") | ||
| public static let coveragePrefixMap: Option = Option("-coverage-prefix-map", .separate, attributes: [.frontend], helpText: "Remap source paths in coverage info") |
There was a problem hiding this comment.
I did this manually because I couldn't get the option generation working, but I think I got the right stuff here
There was a problem hiding this comment.
Looks fine. We can do a separate regeneration pass.
This is analogous to this change in Driver.cpp swiftlang/swift#32175
53e4604 to
58efe70
Compare
|
@swift-ci please test |
This is analogous to this change in Driver.cpp swiftlang/swift#32175