Skip to content

Conversation

rjmansfield
Copy link
Contributor

This enables generating SIL and LLVM IR files during normal compilation using the frontend -sil-output-path and -ir-output-path flags.

Supports both single-file and WMO modes with ile map integration.

rdar://160297898

This enables generating SIL and LLVM IR files during normal
compilation using the frontend -sil-output-path and -ir-output-path flags.

Supports both single-file and WMO modes with ile map integration.

rdar://160297898
@rjmansfield
Copy link
Contributor Author

swiftlang/swift#84392 is the PR for the swift-frontend flags

@rjmansfield
Copy link
Contributor Author

@swift-ci please test

This extends -save-temps to emit SIL and IR alongside existing
temporary files. In the case where an output file map is used with
-save-temps, e.g. incremental compilation, only emit the SIL and
IR if it has been requested as an output in the filemap.

rdar://160297896
@rjmansfield
Copy link
Contributor Author

@swift-ci please test

flag: "-serialize-diagnostics-path")

// Add SIL and IR outputs when explicitly requested via directory options, file maps, or -save-temps
let saveTempsWithoutFileMap = parsedOptions.hasArgument(.saveTemps) && outputFileMap == nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SwiftDriver is meant to provide some forward/backward compatibility with different swift-frontend versions. In this case where -save-temps has been provided, can this check whether the frontend supports the -sil-output-dir option before it it concludes that it should pass the option down? Otherwise, new driver with old swift-frontend will fail for existing users of -save-temps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants