[llvm] 94e6786 - [llvm] Construct SmallVector with ArrayRef (NFC) (#102799)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 11 08:13:14 PDT 2024


Author: Kazu Hirata
Date: 2024-08-11T08:13:11-07:00
New Revision: 94e6786b8007b1d9b871cb5750a80973d685580b

URL: https://github.com/llvm/llvm-project/commit/94e6786b8007b1d9b871cb5750a80973d685580b
DIFF: https://github.com/llvm/llvm-project/commit/94e6786b8007b1d9b871cb5750a80973d685580b.diff

LOG: [llvm] Construct SmallVector with ArrayRef (NFC) (#102799)

Added: 
    

Modified: 
    llvm/lib/TableGen/Record.cpp
    llvm/lib/Transforms/IPO/ExpandVariadics.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index c2883d2cc158c..bcecee8e550c8 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -292,7 +292,7 @@ bool RecordRecTy::typeIsA(const RecTy *RHS) const {
 
 static RecordRecTy *resolveRecordTypes(RecordRecTy *T1, RecordRecTy *T2) {
   SmallVector<Record *, 4> CommonSuperClasses;
-  SmallVector<Record *, 4> Stack(T1->classes_begin(), T1->classes_end());
+  SmallVector<Record *, 4> Stack(T1->getClasses());
 
   while (!Stack.empty()) {
     Record *R = Stack.pop_back_val();

diff  --git a/llvm/lib/Transforms/IPO/ExpandVariadics.cpp b/llvm/lib/Transforms/IPO/ExpandVariadics.cpp
index 3a1f690bf0390..49bfec297bc17 100644
--- a/llvm/lib/Transforms/IPO/ExpandVariadics.cpp
+++ b/llvm/lib/Transforms/IPO/ExpandVariadics.cpp
@@ -238,7 +238,7 @@ class ExpandVariadics : public ModulePass {
 
   FunctionType *inlinableVariadicFunctionType(Module &M, FunctionType *FTy) {
     // The type of "FTy" with the ... removed and a va_list appended
-    SmallVector<Type *> ArgTypes(FTy->param_begin(), FTy->param_end());
+    SmallVector<Type *> ArgTypes(FTy->params());
     ArgTypes.push_back(ABI->vaListParameterType(M));
     return FunctionType::get(FTy->getReturnType(), ArgTypes,
                              /*IsVarArgs=*/false);
@@ -538,7 +538,7 @@ ExpandVariadics::deriveFixedArityReplacement(Module &M, IRBuilder<> &Builder,
   const bool FunctionIsDefinition = !F.isDeclaration();
 
   FunctionType *FTy = F.getFunctionType();
-  SmallVector<Type *> ArgTypes(FTy->param_begin(), FTy->param_end());
+  SmallVector<Type *> ArgTypes(FTy->params());
   ArgTypes.push_back(ABI->vaListParameterType(M));
 
   FunctionType *NFTy = inlinableVariadicFunctionType(M, FTy);


        


More information about the llvm-commits mailing list