Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-13031] Add an experimental flag to dump compiler options #55476

Open
typesanitizer opened this issue Jun 17, 2020 · 1 comment
Open

[SR-13031] Add an experimental flag to dump compiler options #55476

typesanitizer opened this issue Jun 17, 2020 · 1 comment
Labels
compiler The Swift compiler in itself new feature

Comments

@typesanitizer
Copy link

Previous ID SR-13031
Radar rdar://problem/64517046
Original Reporter @typesanitizer
Type New Feature
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels New Feature
Assignee None
Priority Medium

md5: 0ab0ce34bc1423c502c47dfbde41b4dc

Issue Description:

Forum post: https://forums.swift.org/t/a-flag-for-dumping-the-arguments-being-passed-to-the-compiler/37522

The idea would be to print out canonicalized flags, instead of just all the flags. This means:

  • Default values are printed

  • In case of duplicates, the "effective" value is printed.

See the linked forum post for specifics.

I suppose we could add this as a frontend flag -experimental-dump-canonicalized-flags /path/to/dump.txt (I don't feel strongly about the name).

Keith Smiley observed that we already have some facility for printing out these canonicalized flags for swiftinterfaces. Presumably, this flag should work even when library evolution is disabled.

Implementation hints:

  • The code for swiftinterfaces is being invoked in printToolVersionAndFlagsComment. It is dumping the Flags field of the ModuleInterfaceOptions type.

  • There are two functions ParseModuleInterfaceArgs and SaveModuleInterfaceArgs which seem to be involved in computing the relevant flags.

Implementation questions (non-exhaustive):

  • When (in the compiler pipeline) should the flags be dumped? I think it would be nice to emit as soon as possible, so that even if there is a compilation failure, you can get the canonicalized flags that are being used.

  • Are there any flags which are applicable only in the absence of library evolution, and hence need to be taken into account separately (from ModuleInterfaceOptions.Flags) when normalizing?

@typesanitizer
Copy link
Author

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself new feature
Projects
None yet
Development

No branches or pull requests

1 participant