[clang][dataflow][NFC] Fix comments related to widening.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Mon, 19 Dec 2022 14:47:35 +0000 (14:47 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Mon, 19 Dec 2022 21:01:27 +0000 (21:01 +0000)
commitd2e4aaf6ac3bc7c72a81f050512afa17a9ceb54b
tree6282ef55d9247d3953cca020dcae601b56d79d65
parentd81df21421b73763d5aa3fe526de3ebc89a074fb
[clang][dataflow][NFC] Fix comments related to widening.

The comments describing the API for analysis `widen` and the environment `widen`
were overly strict in the preconditions they assumed for the operation. In
particular, both assumed that the previous value preceded the current value in
the relevant ordering. However, that's not generally how widen operators work
and widening itself can violate this property. That is, when the previous value
is the result of a widening, it can easily be "greater" than the current value.

This patch updates the comments to accurately reflect the expectations.

Differential Revision: https://reviews.llvm.org/D140308
clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp