[clang] [clang][Analyzer][NFC] Simplify preDefault/preFseek/preFreadFwrite of StreamChecker (PR #71394)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 6 08:33:33 PST 2023


================
@@ -342,6 +342,11 @@ class StreamChecker : public Checker<check::PreCall, eval::Call,
                          CheckerContext &C,
                          const StreamErrorState &ErrorKind) const;
 
+  /// Perform some common checks for all preXXX functions.
+  bool basicCheck(const FnDescription *Desc, const CallEvent &Call,
+                  CheckerContext &C, ProgramStateRef &State,
+                  SVal &StreamVal) const;
----------------
balazske wrote:

This function has a role like `ensureStreamNonNullAndOpened`, that would be a better name for it. And it should return the  new `State`, like `ensureStreamNonNull`.

https://github.com/llvm/llvm-project/pull/71394


More information about the cfe-commits mailing list