[PATCH] D67381: [analyzer] NFC: Move stack hints to a side map.

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 04:46:44 PDT 2019


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

> I'm open to discuss a better design here. Eg., i thought about making it part of the visitor interface instead, but i don't immediately see how to do this without breaking the logic of "only add the note at the call site in which the event has happened, not every time allocated memory is returned from anywhere".

When I stumbled upon this stack hint thingie during the refactoring of BugReporter.cpp, I found it very clunky, and while I still do, I'm none the wiser about how to do it any better.

Side note, now that you had to work with the freshly rewritten file, do you have any feedback on it?



================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporter.cpp:333-337
+  SmallString<200> buf;
+  llvm::raw_svector_ostream os(buf);
+
+  os << Msg << " via " << ArgIndex << llvm::getOrdinalSuffix(ArgIndex)
+     << " parameter";
----------------
How about a simple twine?


================
Comment at: clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp:34
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
-#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
 #include "llvm/ADT/ArrayRef.h"
----------------
Nice, how did you catch this? Some compiler warning?


Repository:
  rC Clang

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

https://reviews.llvm.org/D67381





More information about the cfe-commits mailing list