[PATCH] D67420: [analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 10 16:49:47 PDT 2019


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a_sidorin, rnkovacs, Szelethus, baloghadamsoftware, Charusso.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet.
Herald added a project: clang.
NoQ added reviewers: alexfh, gribozavr.
NoQ added a parent revision: D67419: [analyzer] NFC: Move PathDiagnostic to libAnalysis..

The `AnalyzerOptions` object contains too much information that's completely specific to the Analyzer. It is also being referenced by path diagnostic consumers to tweak their behavior. If we want path diagnostic consumers to function separately from the Analyzer, we'll have to make a smaller options object that only contains relevant options.

@Szelethus: I could have stored `PathDiagnosticConsumerOptions` in `AnalyzerOptions` by value and pass a const reference around, but it wasn't pleasant to integrate with `AnalyzerOptions.def`. I.e., i'd have to implement a new kind of option that doesn't allocate its own field but instead re-uses a field within a sub-object. Do you want me to go for it or is this implementation good enough or do you have other approaches in mind?


Repository:
  rC Clang

https://reviews.llvm.org/D67420

Files:
  clang/include/clang/Analysis/PathDiagnostic.h
  clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
  clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
  clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
  clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
  clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
  clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67420.219629.patch
Type: text/x-patch
Size: 17157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190910/f676caa5/attachment.bin>


More information about the cfe-commits mailing list