[PATCH] D86465: [analyzer][solver] Redesign constraint ranges data structure

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 08:04:32 PDT 2020


ASDenysPetrov added a comment.

Here is my five cents. I haven't done with the review yet. I'm gonna return to it a bit later.



================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:56
+  bool operator==(const Range &RHS) const { return Impl == RHS.Impl; }
+  bool operator!=(const Range &RHS) const { return !(*this == RHS); }
+
----------------
I'm not sure about optimizations but it seems like it could have less commands by omiting `this`.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:139
+    /// @{
+    RangeSet getSet(Range Origin);
+    RangeSet getSet(const llvm::APSInt &From, const llvm::APSInt &To) {
----------------
IMO function's name should match to what it does. If it creates smth, so its name should starts with `create`. Even if all other functions have misleading names it doesn't mean we are delegated to ignore this fact.
My another suggestion is that `Set` is a common term to `RangeSet`. So I'd prefer to use `getRangeSet` instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86465



More information about the cfe-commits mailing list