about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-15 16:54:31 +0000
committerbors <bors@rust-lang.org>2023-11-15 16:54:31 +0000
commit0b244796388a929affbea546f1c886dc2e482898 (patch)
treecfaad38a46b88be9bf28ec61d321d580e8837c1c /src
parentd4559c01c2bdebad53c01f85064617ac61563a38 (diff)
parent2e6b57541dc28cdd954b1ce2300b88ccc5c29d5c (diff)
Auto merge of #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.
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/compiler-flags/llvm-module-flag.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/compiler-flags/llvm-module-flag.md b/src/doc/unstable-book/src/compiler-flags/llvm-module-flag.md
new file mode 100644
index 00000000000..454ad0a9a6d
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/llvm-module-flag.md
@@ -0,0 +1,12 @@
+# `llvm-module-flag`
+
+---------------------
+
+This flag allows adding a key/value to the `!llvm.module.flags` metadata in the
+LLVM-IR for a compiled Rust 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](https://llvm.org/docs/LangRef.html#module-flags-metadata)