[PATCH] D106644: [clang][analyzer] Add standard streams to alpha.unix.Stream checker.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 29 08:02:40 PDT 2021


martong added a comment.

In D106644#2913676 <https://reviews.llvm.org/D106644#2913676>, @balazske wrote:

> Split some type lookup functions from StdLibraryFunctionsChecker into separate files.

Thank you, this is awesome!



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:504
+
+  OrigStdin = findStdStream("stdin", C);
+  OrigStdout = findStdStream("stdout", C);
----------------
We should be careful, to cache the results (either here, or deeper in the call stack).
I mean, we certainly don't want to do a lookup of "stdin" every time a function is evaluated. We should do this lazily, only once.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106644



More information about the cfe-commits mailing list