1
Fork 0

Rollup merge of #128970 - DianQK:lint-llvm-ir, r=nikic

Add `-Zlint-llvm-ir`

This flag is similar to `-Zverify-llvm-ir` and allows us to lint the generated IR.

r? compiler
This commit is contained in:
Guillaume Gomez 2024-08-29 16:21:47 +02:00 committed by GitHub
commit d5c40d03dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 26 additions and 4 deletions

View file

@ -112,6 +112,7 @@ pub struct ModuleConfig {
// Miscellaneous flags. These are mostly copied from command-line
// options.
pub verify_llvm_ir: bool,
pub lint_llvm_ir: bool,
pub no_prepopulate_passes: bool,
pub no_builtins: bool,
pub time_module: bool,
@ -237,6 +238,7 @@ impl ModuleConfig {
bc_cmdline: sess.target.bitcode_llvm_cmdline.to_string(),
verify_llvm_ir: sess.verify_llvm_ir(),
lint_llvm_ir: sess.opts.unstable_opts.lint_llvm_ir,
no_prepopulate_passes: sess.opts.cg.no_prepopulate_passes,
no_builtins: no_builtins || sess.target.no_builtins,