about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/common.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-12 16:31:22 +0000
committerbors <bors@rust-lang.org>2024-08-12 16:31:22 +0000
commit91376f416222a238227c84a848d168835ede2cc3 (patch)
tree0dc7b9f6c09c2de39e702cb4751563c12b254835 /compiler/rustc_codegen_llvm/src/common.rs
parente08b80c0fb7667bdcd040761891701e576c42ec8 (diff)
parent99a785d62d8414e5db435f4e699eabd185257d49 (diff)
downloadrust-91376f416222a238227c84a848d168835ede2cc3.tar.gz
rust-91376f416222a238227c84a848d168835ede2cc3.zip
Auto merge of #129008 - GuillaumeGomez:rollup-6citttb, r=GuillaumeGomez
Rollup of 10 pull requests

Successful merges:

 - #128149 (nontemporal_store: make sure that the intrinsic is truly just a hint)
 - #128394 (Unify run button display with "copy code" button and with mdbook buttons)
 - #128537 (const vector passed through to codegen)
 - #128632 (std: do not overwrite style in `get_backtrace_style`)
 - #128878 (Slightly refactor `Flags` in bootstrap)
 - #128886 (Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`)
 - #128929 (Fix codegen-units tests that were disabled 8 years ago)
 - #128937 (Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`)
 - #128978 (Use `assert_matches` around the compiler more)
 - #128994 (Fix bug in `Parser::look_ahead`.)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/common.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs
index 65f974c5689..a3997900184 100644
--- a/compiler/rustc_codegen_llvm/src/common.rs
+++ b/compiler/rustc_codegen_llvm/src/common.rs
@@ -97,11 +97,6 @@ impl<'ll> CodegenCx<'ll, '_> {
         unsafe { llvm::LLVMConstArray2(ty, elts.as_ptr(), len) }
     }
 
-    pub fn const_vector(&self, elts: &[&'ll Value]) -> &'ll Value {
-        let len = c_uint::try_from(elts.len()).expect("LLVMConstVector elements len overflow");
-        unsafe { llvm::LLVMConstVector(elts.as_ptr(), len) }
-    }
-
     pub fn const_bytes(&self, bytes: &[u8]) -> &'ll Value {
         bytes_in_context(self.llcx, bytes)
     }
@@ -221,6 +216,11 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         struct_in_context(self.llcx, elts, packed)
     }
 
+    fn const_vector(&self, elts: &[&'ll Value]) -> &'ll Value {
+        let len = c_uint::try_from(elts.len()).expect("LLVMConstVector elements len overflow");
+        unsafe { llvm::LLVMConstVector(elts.as_ptr(), len) }
+    }
+
     fn const_to_opt_uint(&self, v: &'ll Value) -> Option<u64> {
         try_as_const_integral(v).and_then(|v| unsafe {
             let mut i = 0u64;