[PATCH] D82288: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions

Endre Fülöp via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 02:40:14 PDT 2020


gamesh411 added a comment.

Good job, I really fancy the Summary syntax 👍



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:740
   // we have a TypedefDecl with the name 'FILE'.
-  for (Decl *D : LookupRes) {
+  for (Decl *D : LookupRes)
     if (auto *TD = dyn_cast<TypedefNameDecl>(D))
----------------
I presume that typically there are only a handful of `Decl`s in LookupRes, so it not worth the complexity of using `std::algorithm`s to sort/partition/find.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1591
+
+    Optional<RangeInt> Off_tMax;
+    if (Off_tTy) {
----------------
If `Off_tMax` is only used in the if block that follows, consider moving it's declaration inside.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82288





More information about the cfe-commits mailing list