[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 08:13:21 PST 2020


balazske added a comment.

Some explanation of the error states:

- `EofError` indicates an EOF condition in the stream.
- `OtherError` indicates a generic (I/O or other but not EOF) error.
- `AnyError` is a "placeholder" if the exact error kind is not important. This is a "Schrödinger's cat" type of state: If we need to observe the exact error it can change to Eof or Other error. (See code in `evalFeof` and `evalFerror`, probably this is the only place for this event.) This error kind is used to save state splits, other solution is to make for example after fseek a new state for `EofError` and another for `OtherError`. The file error functions are relatively seldomly used (?), because checking success of an operation can be done with the return value and there is no need to check `ferror` or `feof`. And for analyzer warnings it is often enough to know if any error happened, not if exactly **EOF** or other error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75682





More information about the cfe-commits mailing list