NoQ added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:814
 
+Optional<ProgramStateRef> RangeConstraintManager::tryAssumeSymSymOp(
+    ProgramStateRef State, BinaryOperator::Opcode Op, SymbolRef LHSSym,
----------------
I believe you don't need to return an optional here. The method simply 
acknowledges any assumptions it could make in the existing state and returns 
the updated state. Therefore, if it wasn't able to record any assumptions, it 
returns the existing state. Because the only reasonable behavior the caller 
could implement when the current implementation returns `None` is to roll back 
to the existing state anyway.


================
Comment at: clang/test/Analysis/constraint-manager-sym-sym.c:182
+void test_range18(int l, int r) {
+  assert((9 <= r && r <= 9) || (11 <= r && r <= 42) || (44 <= r && r <= 44));
+  assert((0 <= l && l <= 1) || (20 <= l && l <= 20));
----------------
You can also explicitly create a single path with disconnected ranges (as 
opposed to like 3 different paths on each of which the range is a single 
segment) like this:
```lang=c++
assert(r >= 9 && r <= 44 && r != 10 && r != 43);
```


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

https://reviews.llvm.org/D77792



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

Reply via email to