[PATCH] D82585: [analyzer][NFC] Move the data structures from CheckerRegistry to the Core library

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 3 05:54:01 PDT 2020


Szelethus added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/CheckerRegistryData.h:216
+  /// This output is not intended to be machine-parseable.
+  void printCheckerWithDescList(const AnalyzerOptions &AnOpts, raw_ostream &Out,
+                                size_t MaxNameChars = 30) const;
----------------
baloghadamsoftware wrote:
> Why not store `AnOpts` in `CheckerRegistryData`? It would save the need to pass it to every function separately.
This is definitely a point where I chose a well defined interface over convenience. These print functions only have a single user, `CompilerInstance`, which must juggle all sorts of analyzer managers anyways, so it wouldn't have made the code any more readable in my opinion.

The idea was to constrain all data this class has to be strictly about what was processed by `CheckerRegistry`. While mildly inconvenient, the only way to retrieve this object would be from `CheckerManager`, that also has a getter to `AnalyzerOptions`, so in case someone were to use this for debug purposes or something, they certainly can.


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

https://reviews.llvm.org/D82585





More information about the cfe-commits mailing list