[clang] 5997ebd - [analyzer][NFC] Use ArrayRef for input parameters (#93203)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 28 06:38:08 PDT 2024


Author: Balazs Benics
Date: 2024-06-28T15:38:03+02:00
New Revision: 5997ebdb4feae22e83ec23cc9ee14e3eb7a39e10

URL: https://github.com/llvm/llvm-project/commit/5997ebdb4feae22e83ec23cc9ee14e3eb7a39e10
DIFF: https://github.com/llvm/llvm-project/commit/5997ebdb4feae22e83ec23cc9ee14e3eb7a39e10.diff

LOG: [analyzer][NFC] Use ArrayRef for input parameters (#93203)

Fixes #79684

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index 845a5f9b390dc..8f4bd17afc858 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -672,7 +672,7 @@ class StdLibraryFunctionsChecker
     StringRef getNote() const { return Note; }
   };
 
-  using ArgTypes = std::vector<std::optional<QualType>>;
+  using ArgTypes = ArrayRef<std::optional<QualType>>;
   using RetType = std::optional<QualType>;
 
   // A placeholder type, we use it whenever we do not care about the concrete
@@ -1746,7 +1746,7 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
     }
     // Add the same summary for 
diff erent names with the Signature explicitly
     // given.
-    void operator()(std::vector<StringRef> Names, Signature Sign, Summary Sum) {
+    void operator()(ArrayRef<StringRef> Names, Signature Sign, Summary Sum) {
       for (StringRef Name : Names)
         operator()(Name, Sign, Sum);
     }


        


More information about the cfe-commits mailing list