[PATCH] D60107: [analyzer] NoStoreFuncVisitor: Suppress bug reports with no-store in system headers.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 4 19:40:11 PDT 2019


NoQ added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:364
       QualType T = PVD->getType();
-      while (const MemRegion *R = S.getAsRegion()) {
-        if (RegionOfInterest->isSubRegionOf(R) && !isPointerToConst(T))
-          return notModifiedDiagnostics(N, {}, R, ParamName,
-                                        ParamIsReferenceType, IndirectionLevel);
+      while (const MemRegion *MR = S.getAsRegion()) {
+        if (RegionOfInterest->isSubRegionOf(MR) && !isPointerToConst(T))
----------------
Charusso wrote:
> `R` was cool, that is our unspoken naming convention. What about `CallR`/`CallRegion` and possibly `CallSVal`? If I am right usually the `BugReport` object is named `BR` because of our regions.
My unspoken (well, not anymore, i guess) naming convention usually goes like this:
* `B` for `BinaryOperator` (emphasis on binary-ness, `U` for unary so they don't conflict)
* `R` for `BugReport` (emphasis on being a report)
* `BR` for `BugReporter` (for the lack of better name),
* `MR` for `MemRegion` (specific classes of regions go like `VR`, `FR`, `TR`, `SR`, or, well, `BR`)
* `BRC` for `BugReporterContext` (emphasis on being a context)

Also `V` for `SVal` (emphasis on value) because `S` for `Stmt`.


================
Comment at: clang/test/Analysis/no-store-suppression.cpp:3
+
+// expected-no-diagnostics
+
----------------
Charusso wrote:
> Could you inject a link for the diff or copy the information for further improvements why no diagnostic happen?
Links to diffs are rarely included in the source code because they're usually two clicks away anyway: just do git blame and see the bottom of the commit message.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60107/new/

https://reviews.llvm.org/D60107





More information about the cfe-commits mailing list