[PATCH] D125893: [RISCV][NFC] Change interface of RVVIntrinsic::getSuffixStr

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 18 08:21:01 PDT 2022


kito-cheng created this revision.
kito-cheng added a reviewer: khchen.
Herald added subscribers: sunshaoce, VincentWu, luke957, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, arichardson.
Herald added a project: All.
kito-cheng requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: clang.

This NFC patch is splited from D111617 <https://reviews.llvm.org/D111617>.

Using llvm::ArrayRef rather than llvm::SmallVector, ArrayRef is more generic
interface that could accept both llvm::ArrayRef and llvm::SmallVector.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125893

Files:
  clang/include/clang/Support/RISCVVIntrinsicUtils.h
  clang/lib/Support/RISCVVIntrinsicUtils.cpp


Index: clang/lib/Support/RISCVVIntrinsicUtils.cpp
===================================================================
--- clang/lib/Support/RISCVVIntrinsicUtils.cpp
+++ clang/lib/Support/RISCVVIntrinsicUtils.cpp
@@ -928,7 +928,7 @@
 
 std::string RVVIntrinsic::getSuffixStr(
     BasicType Type, int Log2LMUL,
-    const llvm::SmallVector<PrototypeDescriptor> &PrototypeDescriptors) {
+    const llvm::ArrayRef<PrototypeDescriptor> &PrototypeDescriptors) {
   SmallVector<std::string> SuffixStrs;
   for (auto PD : PrototypeDescriptors) {
     auto T = RVVType::computeType(Type, Log2LMUL, PD);
Index: clang/include/clang/Support/RISCVVIntrinsicUtils.h
===================================================================
--- clang/include/clang/Support/RISCVVIntrinsicUtils.h
+++ clang/include/clang/Support/RISCVVIntrinsicUtils.h
@@ -341,9 +341,10 @@
   // Return the type string for a BUILTIN() macro in Builtins.def.
   std::string getBuiltinTypeStr() const;
 
-  static std::string getSuffixStr(
-      BasicType Type, int Log2LMUL,
-      const llvm::SmallVector<PrototypeDescriptor> &PrototypeDescriptors);
+  static std::string
+  getSuffixStr(BasicType Type, int Log2LMUL,
+               const llvm::ArrayRefSmallVector<PrototypeDescriptor>
+                   &PrototypeDescriptors);
 };
 
 } // end namespace RISCV


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125893.430388.patch
Type: text/x-patch
Size: 1326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220518/8a805e76/attachment-0001.bin>


More information about the cfe-commits mailing list