]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_target/abi/call/riscv.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc_target / abi / call / riscv.rs
index ba82e49ddb03ef75576dc301bd90d39f921de484..095e5aff74422235abb2460028e0a60002150569 100644 (file)
@@ -1,9 +1,9 @@
 // Reference: RISC-V ELF psABI specification
 // https://github.com/riscv/riscv-elf-psabi-doc
 
-use crate::abi::call::{ArgType, FnType};
+use crate::abi::call::{ArgAbi, FnAbi};
 
-fn classify_ret_ty<Ty>(arg: &mut ArgType<'_, Ty>, xlen: u64) {
+fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
     // "Scalars wider than 2✕XLEN are passed by reference and are replaced in
     // the argument list with the address."
     // "Aggregates larger than 2✕XLEN bits are passed by reference and are
@@ -19,7 +19,7 @@ fn classify_ret_ty<Ty>(arg: &mut ArgType<'_, Ty>, xlen: u64) {
     arg.extend_integer_width_to(xlen); // this method only affects integer scalars
 }
 
-fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>, xlen: u64) {
+fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
     // "Scalars wider than 2✕XLEN are passed by reference and are replaced in
     // the argument list with the address."
     // "Aggregates larger than 2✕XLEN bits are passed by reference and are
@@ -35,15 +35,15 @@ fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>, xlen: u64) {
     arg.extend_integer_width_to(xlen); // this method only affects integer scalars
 }
 
-pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>, xlen: u64) {
-    if !fty.ret.is_ignore() {
-        classify_ret_ty(&mut fty.ret, xlen);
+pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>, xlen: u64) {
+    if !fn_abi.ret.is_ignore() {
+        classify_ret(&mut fn_abi.ret, xlen);
     }
 
-    for arg in &mut fty.args {
+    for arg in &mut fn_abi.args {
         if arg.is_ignore() {
             continue;
         }
-        classify_arg_ty(arg, xlen);
+        classify_arg(arg, xlen);
     }
 }