diff options
author | Fangrui Song <maskray@google.com> | 2018-08-02 16:29:36 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-08-02 16:29:36 +0000 |
commit | 98768e40fe1c845928b7a96edb8315f477c09e91 (patch) | |
tree | 68115351e4d32f004d332239f3cec0ae27f0b508 | |
parent | 84e74362c1d556d4626eca9a5d4984e3a32626ee (diff) | |
download | bcm5719-llvm-98768e40fe1c845928b7a96edb8315f477c09e91.tar.gz bcm5719-llvm-98768e40fe1c845928b7a96edb8315f477c09e91.zip |
[analyzer] Make RegionVector use const reference
llvm-svn: 338732
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index a89758d02c4..8793755ad38 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -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) |