-
Notifications
You must be signed in to change notification settings - Fork 244
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
Add support for outputting multiple modules, one per entry point #551
Conversation
thanks, my brain is mush right now :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep the example. in the future we might want to use a toggle for that in the existing examples tho 🤷
@@ -380,6 +380,9 @@ impl CodegenBackend for SpirvCodegenBackend { | |||
) -> Result<(), ErrorReported> { | |||
// TODO: Can we merge this sym with the one in symbols.rs? | |||
let legalize = !sess.target_features.contains(&Symbol::intern("kernel")); | |||
let emit_multiple_modules = sess | |||
.target_features | |||
.contains(&Symbol::intern("multimodule")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be more appropriate if we accepted this as an argument from -Cllvm-args
(sess.cg.llvm_args
)? It's not really something that's specific to the the target as it is specific to our backend. Another benefit is since it is just Vec<String>
, we could use clap here for getting these arguments, that's make it to have key value arguments like --module-output=[multiple|single]
.
* Add multimodule feature * Use -Cllvm-args instead of -Ctarget-feature for multimodule * Fix cargo.toml
Fixes #539
Not sure if I should actually include the
examples/multibuilder
crate, I'm fine with deleting it (also for some reason it only works when cd'ing into the dir and runningcargo run --release
, it fails to find thecargo
exe when running withcargo run --release -p multibuilder
)