<div dir="ltr">Looks good! Though it may be useful in the future to describe, in the commit message, the motivation for a change - how'd you find this? What motivated you to make this particular fix just now, etc? ("identified using clang-tidy" or "spotted during post-commit review of change rXXXX", etc...)</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 2, 2018 at 9:29 AM Fangrui Song via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: maskray<br>
Date: Thu Aug  2 09:29:36 2018<br>
New Revision: 338732<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=338732&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=338732&view=rev</a><br>
Log:<br>
[analyzer] Make RegionVector use const reference<br>
<br>
Modified:<br>
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp<br>
<br>
Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=338732&r1=338731&r2=338732&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=338732&r1=338731&r2=338732&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)<br>
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Thu Aug  2 09:29:36 2018<br>
@@ -395,7 +395,7 @@ private:<br>
   const Optional<RegionVector><br>
   findRegionOfInterestInRecord(const RecordDecl *RD, ProgramStateRef State,<br>
                                const MemRegion *R,<br>
-                               RegionVector Vec = {},<br>
+                               const RegionVector &Vec = {},<br>
                                int depth = 0) {<br>
<br>
     if (depth == DEREFERENCE_LIMIT) // Limit the recursion depth.<br>
@@ -548,14 +548,10 @@ private:<br>
<br>
   /// \return Diagnostics piece for region not modified in the current function.<br>
   std::shared_ptr<PathDiagnosticPiece><br>
-  notModifiedDiagnostics(const LocationContext *Ctx,<br>
-                         CallExitBegin &CallExitLoc,<br>
-                         CallEventRef<> Call,<br>
-                         RegionVector FieldChain,<br>
-                         const MemRegion *MatchedRegion,<br>
-                         StringRef FirstElement,<br>
-                         bool FirstIsReferenceType,<br>
-                         unsigned IndirectionLevel) {<br>
+  notModifiedDiagnostics(const LocationContext *Ctx, CallExitBegin &CallExitLoc,<br>
+                         CallEventRef<> Call, const RegionVector &FieldChain,<br>
+                         const MemRegion *MatchedRegion, StringRef FirstElement,<br>
+                         bool FirstIsReferenceType, unsigned IndirectionLevel) {<br>
<br>
     PathDiagnosticLocation L;<br>
     if (const ReturnStmt *RS = CallExitLoc.getReturnStmt()) {<br>
@@ -579,7 +575,8 @@ private:<br>
   /// Pretty-print region \p MatchedRegion to \p os.<br>
   void prettyPrintRegionName(StringRef FirstElement, bool FirstIsReferenceType,<br>
                              const MemRegion *MatchedRegion,<br>
-                             RegionVector FieldChain, int IndirectionLevel,<br>
+                             const RegionVector &FieldChain,<br>
+                             int IndirectionLevel,<br>
                              llvm::raw_svector_ostream &os) {<br>
<br>
     if (FirstIsReferenceType)<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>