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

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 20 06:10:53 PDT 2019


gribozavr added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:347
+
+  virtual llvm::ArrayRef<FixItHint> getFixits() const { return Fixits; }
+
----------------
Why is it virtual? In fact, why is BugReporter subclassable at all?


================
Comment at: clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:751
+        o << "    <key>insert_string</key>\n";
+        o << "    <string>" << Hint.CodeToInsert << "</string>\n";
+        o << "   </dict>\n";
----------------
Escaping?


================
Comment at: clang/test/Analysis/dead-stores.c:11
   long idx=abc+3*5; // expected-warning {{never read}} expected-warning{{unused variable 'idx'}}
+  // expected-remark-re at -1{{{{.*}}:11 - {{.*}}:18 - ''}}
 }
----------------
If the tests ignore the line number anyway, why even print it?


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

https://reviews.llvm.org/D65182





More information about the cfe-commits mailing list