[PATCH] D84415: [analyzer][StdLibraryFunctionsChecker] Add POSIX pthread handling functions

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 07:59:01 PDT 2020


vsavchenko added a comment.

Off-topic: I really think that we should have some sort of DSL for that kind of stuff.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:2013
+    if (Pthread_tTy) {
+      Pthread_tPtrTy = ACtx.getPointerType(*Pthread_tTy);
+      Pthread_tPtrRestrictTy = getRestrictTy(*Pthread_tPtrTy);
----------------
It feels like the readability of the code here can be drastically improved by introducing functions `getPointerType`, `getRestrictType`, and similar accepting `Optional` arguments. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84415



More information about the cfe-commits mailing list