LLVM 16: Switch to using MemoryEffects

This commit is contained in:
Tim Neumann
2022-11-04 16:20:42 +00:00
parent 47c008e440
commit c15cfc91c4
8 changed files with 67 additions and 12 deletions

View File

@@ -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 {