about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm/mod.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-02-24 07:56:00 +0100
committerRalf Jung <post@ralfj.de>2025-02-24 07:56:00 +0100
commit18e19b9f04fed7363056fc19f5f836c05fd858de (patch)
treea5355f8c6e871a3feb9e502b1ecebe6f6f561f56 /compiler/rustc_codegen_llvm/src/llvm/mod.rs
parente4de3acb971ce3c22d2cea43a8664bc570a9b3a8 (diff)
parenta4a9fb412e1b0420b570a2d6ac2cf81142c5cc11 (diff)
downloadrust-18e19b9f04fed7363056fc19f5f836c05fd858de.tar.gz
rust-18e19b9f04fed7363056fc19f5f836c05fd858de.zip
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
index efc9cf2ef69..5ec93424131 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
@@ -403,3 +403,15 @@ pub(crate) fn add_module_flag_str(
         );
     }
 }
+
+pub(crate) fn set_dllimport_storage_class<'ll>(v: &'ll Value) {
+    unsafe {
+        LLVMSetDLLStorageClass(v, DLLStorageClass::DllImport);
+    }
+}
+
+pub(crate) fn set_dso_local<'ll>(v: &'ll Value) {
+    unsafe {
+        LLVMRustSetDSOLocal(v, true);
+    }
+}