about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-07 02:15:39 +0000
committerbors <bors@rust-lang.org>2022-11-07 02:15:39 +0000
commit9b735a7132acd58b3bd34c084e9ca5b4ca7450a2 (patch)
treea551182bfce55b37e2ba49f98be4796bf1e94093 /compiler/rustc_codegen_llvm/src
parent7eef946fc0e0eff40e588eab77b09b287accbec3 (diff)
parent7ca833efe07a918f3ba89630da312d3fd6a85e01 (diff)
downloadrust-9b735a7132acd58b3bd34c084e9ca5b4ca7450a2.tar.gz
rust-9b735a7132acd58b3bd34c084e9ca5b4ca7450a2.zip
Auto merge of #104083 - JohnTitor:rollup-lo3wbzs, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #103885 (rustdoc: various cross-crate reexport fixes)
 - #103914 (Make underscore_literal_suffix a hard error.)
 - #104045 (Add type_array to BaseTypeMethods)
 - #104056 (Vec: IntoIterator signature consistency)
 - #104059 (Fix typo in `rustc_middle/lint.rs`)
 - #104062 (rustdoc: remove unused CSS `#sidebar-filler`)
 - #104065 (Migrate rust logo filter to CSS variables)
 - #104066 (LLVM 16: Update RISCV data layout)
 - #104074 (rustdoc: Add an example for round that is different from truncate)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs4
-rw-r--r--compiler/rustc_codegen_llvm/src/type_.rs8
2 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index 79ddfd884df..c22ec128dac 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -158,6 +158,10 @@ pub unsafe fn create_module<'ll>(
         if sess.target.arch == "s390x" {
             target_data_layout = target_data_layout.replace("-v128:64", "");
         }
+
+        if sess.target.arch == "riscv64" {
+            target_data_layout = target_data_layout.replace("-n32:64-", "-n64-");
+        }
     }
 
     // Ensure the data-layout values hardcoded remain the defaults.
diff --git a/compiler/rustc_codegen_llvm/src/type_.rs b/compiler/rustc_codegen_llvm/src/type_.rs
index eeb38d4ecf5..5eec7dc6130 100644
--- a/compiler/rustc_codegen_llvm/src/type_.rs
+++ b/compiler/rustc_codegen_llvm/src/type_.rs
@@ -127,10 +127,6 @@ impl<'ll> CodegenCx<'ll, '_> {
     pub(crate) fn type_variadic_func(&self, args: &[&'ll Type], ret: &'ll Type) -> &'ll Type {
         unsafe { llvm::LLVMFunctionType(ret, args.as_ptr(), args.len() as c_uint, True) }
     }
-
-    pub(crate) fn type_array(&self, ty: &'ll Type, len: u64) -> &'ll Type {
-        unsafe { llvm::LLVMRustArrayType(ty, len) }
-    }
 }
 
 impl<'ll, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
@@ -231,6 +227,10 @@ impl<'ll, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
     fn val_ty(&self, v: &'ll Value) -> &'ll Type {
         common::val_ty(v)
     }
+
+    fn type_array(&self, ty: &'ll Type, len: u64) -> &'ll Type {
+        unsafe { llvm::LLVMRustArrayType(ty, len) }
+    }
 }
 
 impl Type {