diff options
| author | bors <bors@rust-lang.org> | 2024-04-01 03:16:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-01 03:16:45 +0000 |
| commit | defef8658e8f740cc8d2818b5b96441071e9a7a6 (patch) | |
| tree | d83fa1b9a04bc318756c11d60243d39ddb487bf2 /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | 66de6111960571ab7b030c205b6176801c7ecbfc (diff) | |
| parent | 6e5f1dacf3a670cf03111039a032c765355839aa (diff) | |
| download | rust-defef8658e8f740cc8d2818b5b96441071e9a7a6.tar.gz rust-defef8658e8f740cc8d2818b5b96441071e9a7a6.zip | |
Auto merge of #122972 - beetrees:use-align-type, r=fee1-dead
Use the `Align` type when parsing alignment attributes Use the `Align` type in `rustc_attr::parse_alignment`, removing the need to call `Align::from_bytes(...).unwrap()` later in the compilation process.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs index 4f5cc575da6..6ab1eea9597 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs @@ -11,6 +11,7 @@ pub use self::RealPredicate::*; use libc::c_uint; use rustc_data_structures::small_c_str::SmallCStr; use rustc_llvm::RustString; +use rustc_target::abi::Align; use std::cell::RefCell; use std::ffi::{CStr, CString}; use std::str::FromStr; @@ -229,9 +230,9 @@ pub fn set_visibility(llglobal: &Value, visibility: Visibility) { } } -pub fn set_alignment(llglobal: &Value, bytes: usize) { +pub fn set_alignment(llglobal: &Value, align: Align) { unsafe { - ffi::LLVMSetAlignment(llglobal, bytes as c_uint); + ffi::LLVMSetAlignment(llglobal, align.bytes() as c_uint); } } |
