r338732 - [analyzer] Make RegionVector use const reference

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 2 09:29:37 PDT 2018


Author: maskray
Date: Thu Aug  2 09:29:36 2018
New Revision: 338732

URL: http://llvm.org/viewvc/llvm-project?rev=338732&view=rev
Log:
[analyzer] Make RegionVector use const reference

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=338732&r1=338731&r2=338732&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Thu Aug  2 09:29:36 2018
@@ -395,7 +395,7 @@ private:
   const Optional<RegionVector>
   findRegionOfInterestInRecord(const RecordDecl *RD, ProgramStateRef State,
                                const MemRegion *R,
-                               RegionVector Vec = {},
+                               const RegionVector &Vec = {},
                                int depth = 0) {
 
     if (depth == DEREFERENCE_LIMIT) // Limit the recursion depth.
@@ -548,14 +548,10 @@ private:
 
   /// \return Diagnostics piece for region not modified in the current function.
   std::shared_ptr<PathDiagnosticPiece>
-  notModifiedDiagnostics(const LocationContext *Ctx,
-                         CallExitBegin &CallExitLoc,
-                         CallEventRef<> Call,
-                         RegionVector FieldChain,
-                         const MemRegion *MatchedRegion,
-                         StringRef FirstElement,
-                         bool FirstIsReferenceType,
-                         unsigned IndirectionLevel) {
+  notModifiedDiagnostics(const LocationContext *Ctx, CallExitBegin &CallExitLoc,
+                         CallEventRef<> Call, const RegionVector &FieldChain,
+                         const MemRegion *MatchedRegion, StringRef FirstElement,
+                         bool FirstIsReferenceType, unsigned IndirectionLevel) {
 
     PathDiagnosticLocation L;
     if (const ReturnStmt *RS = CallExitLoc.getReturnStmt()) {
@@ -579,7 +575,8 @@ private:
   /// Pretty-print region \p MatchedRegion to \p os.
   void prettyPrintRegionName(StringRef FirstElement, bool FirstIsReferenceType,
                              const MemRegion *MatchedRegion,
-                             RegionVector FieldChain, int IndirectionLevel,
+                             const RegionVector &FieldChain,
+                             int IndirectionLevel,
                              llvm::raw_svector_ostream &os) {
 
     if (FirstIsReferenceType)




More information about the cfe-commits mailing list