[llvm] [AVR] Drop std::size from ArrayRef (NFC) (PR #96076)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 07:04:36 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/96076

ArrayRef infers the size of a C array, so we can drop std::size.

>From 307279b90c47fcf07ad923ed247872bb263b00ff Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 19 Jun 2024 06:54:29 -0700
Subject: [PATCH] [AVR] Drop std::size from ArrayRef (NFC)

ArrayRef infers the size of a C array, so we can drop std::size.
---
 llvm/lib/Target/AVR/AVRISelLowering.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Target/AVR/AVRISelLowering.cpp b/llvm/lib/Target/AVR/AVRISelLowering.cpp
index 7732cb08e24d8..8346b1c119ee9 100644
--- a/llvm/lib/Target/AVR/AVRISelLowering.cpp
+++ b/llvm/lib/Target/AVR/AVRISelLowering.cpp
@@ -1346,11 +1346,11 @@ static void analyzeReturnValues(const SmallVectorImpl<ArgT> &Args,
   ArrayRef<MCPhysReg> RegList8;
   ArrayRef<MCPhysReg> RegList16;
   if (Tiny) {
-    RegList8 = ArrayRef(RegList8Tiny, std::size(RegList8Tiny));
-    RegList16 = ArrayRef(RegList16Tiny, std::size(RegList16Tiny));
+    RegList8 = ArrayRef(RegList8Tiny);
+    RegList16 = ArrayRef(RegList16Tiny);
   } else {
-    RegList8 = ArrayRef(RegList8AVR, std::size(RegList8AVR));
-    RegList16 = ArrayRef(RegList16AVR, std::size(RegList16AVR));
+    RegList8 = ArrayRef(RegList8AVR);
+    RegList16 = ArrayRef(RegList16AVR);
   }
 
   // GCC-ABI says that the size is rounded up to the next even number,



More information about the llvm-commits mailing list