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


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:506-507
+  ///
+  /// where abs(Origin) is the maximal absolute value of any possible values
+  ///       from Origin, and min(T) is a minimal value for the type T.
+  ///
----------------
NoQ wrote:
> I suggest not trying to express signed types and unsigned types in a single 
> formula, the reader will have to unwrap it back into the two cases anyway in 
> order to understand what's going on.
> 
> The following would imho be easier to read: "If T is signed, return the 
> smallest range `[-x..x]` that covers the original range, or `[-min(T), 
> max(T)]` if the aforementioned symmetric range doesn't exist due to original 
> range covering `min(T)`). If T is unsigned, return the smallest range 
> `[0..x]` that covers the original range".
That is a perfect explanation, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80117



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to