You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
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 theFlags
field of theModuleInterfaceOptions
type.There are two functions
ParseModuleInterfaceArgs
andSaveModuleInterfaceArgs
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?The text was updated successfully, but these errors were encountered: