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

Infer emit-bc feature if -lto is passed #1207

Closed

Conversation

mjburghard
Copy link
Contributor

When passing -lto=llvm-thin or -lto=llvm-full to swiftc, it switches from emitting object files to bitcode files.
To include llvm-bc instead of object in the generated output-file-map, the feature SWIFT_FEATURE_EMIT_BC (swift.emit_bc) must be inferred.
This PR implements this similar to SWIFT_FEATURE__WMO_IN_SWIFTCOPTS.

@mjburghard mjburghard marked this pull request as ready for review May 22, 2024 14:51
@mjburghard mjburghard force-pushed the lto-output-file-mapping branch from 274115f to f6e5108 Compare May 22, 2024 14:56
@keith
Copy link
Member

keith commented May 22, 2024

i think probably instead of doing this we should add new features for LTO which add these flags automatically, as well as the required feature?

@mjburghard
Copy link
Contributor Author

@keith Something like swift.thin_lto and swift.full_lto? I found the feature for the unix_cc_toolchain. I may need a couple of pointers, but can look into this.

@keith
Copy link
Member

keith commented May 22, 2024

yea that's what im thinking. generally we use new features for this stuff vs checking in on the command line args. at least one reason why that's nicer is command line arguments can be negated / overwritten and we'd probably need to handle that

@mjburghard
Copy link
Contributor Author

First draft is in #1208

@luispadron luispadron closed this May 25, 2024
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.

4 participants