[PATCH] D62479: [Analyzer] Replace `CXXSelfAssignmentBRVisitor` with `NoteTags`

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 20:48:03 PDT 2019

NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Yay, cool!

Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:2388-2390
-  if (Tag->getTagDescription() != "cplusplus.SelfAssignment")
-    return nullptr;
Looks like you almost invented note tags here :)

Comment at: lib/StaticAnalyzer/Core/PathDiagnostic.cpp:736-738
+        // If the BlockEdge has no terminator condition statement (e.g. a
+        // checker crated the branch at the beginning of a function), use the
+        // function's declaration instead.
Could you assert that this is indeed the case? Like, check that the "from" `CFGBlock` of the edge is the current CFG's ENTRY block? 'Cause it's not obvious that the beginning of the function is the correct source location in all cases where the `CFGTerminator` is not present (you should also be able to assert that the `CFGTerminator` is not present, but i don't think it's the right thing to assert, as we might add more kinds of statement-less `CFGTerminator`s in the future).

  rC Clang



More information about the cfe-commits mailing list