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
Auto merge of rust-lang#116555 - paulmenage:llvm-module-flag, r=wesleywiser
Add -Z llvm_module_flag
Allow adding values to the `!llvm.module.flags` metadata for a generated module. The syntax is
`-Z llvm_module_flag=<name>:<type>:<value>:<behavior>`
Currently only u32 values are supported but the type is required to be specified for forward compatibility. The `behavior` element must match one of the named LLVM metadata behaviors.viors.
This flag is expected to be perma-unstable.
Copy file name to clipboardExpand all lines: compiler/rustc_session/src/options.rs
+30
Original file line number
Diff line number
Diff line change
@@ -429,6 +429,7 @@ mod desc {
429
429
pubconst parse_remap_path_scope:&str = "comma separated list of scopes: `macro`, `diagnostics`, `unsplit-debuginfo`, `split-debuginfo`, `split-debuginfo-path`, `object`, `all`";
430
430
pubconst parse_inlining_threshold:&str =
431
431
"either a boolean (`yes`, `no`, `on`, `off`, etc), or a non-negative number";
432
+
pubconst parse_llvm_module_flag:&str = "<key>:<type>:<value>:<behavior>. Type must currently be `u32`. Behavior should be one of (`error`, `warning`, `require`, `override`, `append`, `appendunique`, `max`, `min`)";
432
433
}
433
434
434
435
mod parse {
@@ -1331,6 +1332,33 @@ mod parse {
1331
1332
}
1332
1333
true
1333
1334
}
1335
+
1336
+
pub(crate)fnparse_llvm_module_flag(
1337
+
slot:&mutVec<(String,u32,String)>,
1338
+
v:Option<&str>,
1339
+
) -> bool{
1340
+
let elements = v.unwrap_or_default().split(':').collect::<Vec<_>>();
0 commit comments