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.
This commit is contained in:
parent
2c1b65ee14
commit
2e6b57541d
5 changed files with 68 additions and 0 deletions
7
tests/codegen/llvm_module_flags.rs
Normal file
7
tests/codegen/llvm_module_flags.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Test for -Z llvm_module_flags
|
||||
// compile-flags: -Z llvm_module_flag=foo:u32:123:error -Z llvm_module_flag=bar:u32:42:max
|
||||
|
||||
fn main() {}
|
||||
|
||||
// CHECK: !{i32 1, !"foo", i32 123}
|
||||
// CHECK: !{i32 7, !"bar", i32 42}
|
Loading…
Add table
Add a link
Reference in a new issue