[PATCH] D65723: [analyzer][NFC] Add different interestingness kinds

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 21 12:24:14 PDT 2019


Szelethus marked an inline comment as done.
Szelethus added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:92-101
   /// Default tracking kind -- specifies that as much information should be
   /// gathered about the tracked expression value as possible.
-  Thorough,
+  Thorough = 0,
   /// Specifies that a more moderate tracking should be used for the expression
   /// value. This will essentially make sure that functions relevant to the it
   /// aren't pruned, but otherwise relies on the user reading the code or
   /// following the arrows.
----------------
NoQ wrote:
> We usually rely on our "unhandled switch case" warnings for noticing all the places which we need to expand when we're adding a new case. Your approach requires adding static asserts all over the place instead - not sure what's better. I guess they're not generally mutually exclusive, however `NumTrackingKinds` makes it impossible to handle all cases in a switch (because `NumTrackingKinds` itself wouldn't ever be handled). I took some sort of middleground approach in `CFGTerminator::Kind` in D61814 but i'm very much open to suggestions.
I agree with your reasoning. I decided to remove `NumTrackingKinds` and use a switch AND `llvm_unreachable` as well if the warning wasn't scary enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65723





More information about the cfe-commits mailing list