From: Fangrui Song Date: Thu, 2 Aug 2018 16:29:36 +0000 (+0000) Subject: [analyzer] Make RegionVector use const reference X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d631d4f581fed4de1f707bd8e3a17d3fbd0fb4b;p=clang [analyzer] Make RegionVector use const reference git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338732 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index a89758d02c..8793755ad3 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -395,7 +395,7 @@ private: const Optional 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 - 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)