about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-05 15:06:06 +0000
committerbors <bors@rust-lang.org>2022-11-05 15:06:06 +0000
commit7910caf9e452a27fd57143d8f7732830927e31ae (patch)
treef76015608b2a3fcdbdc5dc7f50049e089c6666d6 /compiler/rustc_codegen_llvm/src/llvm/mod.rs
parent4492c029eff7b42e91e759576ab0c7ca88f873dc (diff)
parent83239c2c1ebed372dd34016bdd75d02e4429589d (diff)
downloadrust-7910caf9e452a27fd57143d8f7732830927e31ae.tar.gz
rust-7910caf9e452a27fd57143d8f7732830927e31ae.zip
Auto merge of #2650 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
index 6602a4ab863..f820e752371 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
@@ -185,6 +185,13 @@ impl AttributeKind {
     }
 }
 
+impl MemoryEffects {
+    /// Create an LLVM Attribute with these memory effects.
+    pub fn create_attr(self, llcx: &Context) -> &Attribute {
+        unsafe { LLVMRustCreateMemoryEffectsAttr(llcx, self) }
+    }
+}
+
 pub fn set_section(llglobal: &Value, section_name: &str) {
     let section_name_cstr = CString::new(section_name).expect("unexpected CString error");
     unsafe {