[PATCH] D65182: [analyzer] Add fix-it hint support.

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 18 11:14:20 PDT 2019


a_sidorin added a comment.

Hi Artem!
The patch looks very promising for CSA, thanks for working on this!



================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:343
+  /// to produce a good fix-it hint for most path-sensitive warnings.
+  void addFixItHint(FixItHint F) {
+    Fixits.push_back(F);
----------------
As I see, FixItHint is a pretty expensive class to copy. Should we consider const ref/move?


================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporter.cpp:3100
+    R->addRange(SR);
+  for (auto FH : Fixits)
+    R->addFixItHint(FH);
----------------
const auto&/auto&&?


================
Comment at: clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:741
+      o << "  <array>\n";
+      for (auto Hint : D->getFixits()) {
+        assert(!Hint.isNull());
----------------
const auto&?


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

https://reviews.llvm.org/D65182





More information about the cfe-commits mailing list