[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-28 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd8a2afb244da: [clang][analyzer] Add modeling of 'errno'. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The current build errors are probably not related, the Windows test failure shows up in other differential objects. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 _

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 411750. balazske added a comment. Herald added a subscriber: manas. Removed the static variable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 Files: clang/inclu

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D120310#3345696 , @balazske wrote: > The "hip-link-bundle-archive" test looks really unrelated, the others are > fixed if we go back to `-DERRNO_VAR` (no `"` characters in command line, and > probably `/` does not work too).

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 411421. balazske added a comment. Another try to fix the test failures, rebased to current main. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 Files: clang/inclu

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The "hip-link-bundle-archive" test looks really unrelated, the others are fixed if we go back to `-DERRNO_VAR` (no `"` characters in command line, and probably `/` does not work too). There are Debian build errors but these look unrelated(?). Repository: rG LLVM Gi

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. according to the pre-merge checks it still fails on windows and Debian. https://buildkite.com/llvm-project/premerge-checks/builds/81130#ce8f3062-699e-4043-aed9-b891ec8ebee6 https://buildkite.com/llvm-project/premerge-checks/builds/81130#53beb4a2-2c53-4ff0-b60f-6130ed5d25c

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 411398. balazske added a comment. Rename of "Errno.h", maybe fixes Windows build problem. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 Files: clang/include/clan

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Hello! I had to revert in f9e8e92cf586d9cf077139a338f062a91b8ce2d2 because this broke all of the builds on Windows. Here are some sample failures: https://lab.llvm.org/buildbot/#/builders/86/bui

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG29b512ba322c: [clang][analyzer] Add modeling of 'errno'. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 411363. balazske added a comment. Fixed remaining problems. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 Files: clang/include/clang/StaticAnalyzer/Checkers/Chec

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. Looks great, thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 ___ cfe-commits mailing list cfe

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Errno.h:22 +namespace ento { +namespace errno_check { + steakhal wrote: > balazske wrote: > > steakhal wrote: > > > I think we can settle on s

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 411340. balazske added a comment. Removed `isErrnoAvailable`, added test for `getErrnoValue`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 Files: clang/include/

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-24 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. The patch looks great to me now. As soon as you address comments about `isErrnoAvailable()` (at least, the parameter can now be removed), I think you can commit. Repository: rG LLVM Github Monor

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno'.

2022-02-24 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 411149. balazske marked 3 inline comments as done. balazske edited the summary of this revision. balazske added a comment. Changed name of the checker to `ErrnoModeling`, other small cleanup. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-24 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 4 inline comments as done. balazske added inline comments. Comment at: clang/test/Analysis/global-region-invalidation.c:6 // Note, we do need to include headers here, since the analyzer checks if the function declaration is located in a system header. +#include

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-24 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 411131. balazske added a comment. Improved the tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.t

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:767-768 s->getType()->isBlockPointerType()); -assert(isa(sreg) || isa(sreg)); +assert(isa(sreg) || isa(sreg) || + isa(sreg)); } -

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:351-353 +def ErrnoChecker : Checker<"Errno">, + HelpText<"Make the special value 'errno' available to other checkers.">, + Documentation; I think `ErrnoModeling`

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Errno.h:22 +namespace ento { +namespace errno_check { + steakhal wrote: > I think we can settle on something better. What about calling it simply > `errno`? Just `errno` may not work b

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 410824. balazske marked 7 inline comments as done. balazske added a comment. Addressed a part of the review comments. The test checker is now a separate checker. Initialization is simplified, `checkASTDecl` is used. Repository: rG LLVM Github Monorepo CH

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:767-768 s->getType()->isBlockPointerType()); -assert(isa(sreg) || isa(sreg)); +assert(isa(sreg) || isa(sreg) || + isa(sreg)); }

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:767-768 s->getType()->isBlockPointerType()); -assert(isa(sreg) || isa(sreg)); +assert(isa(sreg) || isa(sreg) || + isa(sreg)); } -

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-22 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Good start! However, I'm not a big fan of coupling the testing checker with the actual modeling checker. IMO we should have a distinct checker, similarly to `TaintTester`. That way you could do even fancier things like: define `mylib_may_fail()`, bifurcate and return `

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-22 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added reviewers: NoQ, steakhal, martong. balazske added a comment. Herald added subscribers: ormris, rnkovacs. Documentation not added yet. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120310/new/ https://reviews.llvm.org/D120310 ___

[PATCH] D120310: [clang][analyzer] Add modeling of 'errno' (work-in-progress).

2022-02-22 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun, mgorny. Herald added a reviewer: Szelethus. balazske requested review of this revision. Herald a