[PATCH] D125709: [analyzer][Casting] Support isa, cast, dyn_cast of SVals

2022-05-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Thanks for your help @bzcheeseman! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125709/new/ https://reviews.llvm.org/D125709 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D125771: [clang-tidy] Add a useful note about -std=c++11-or-later

2022-05-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430069. steakhal marked an inline comment as done. steakhal added a comment. fix typo `withing` -> `within` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125771/new/ https://reviews.llvm.org/D125771 Files:

[PATCH] D125749: [analyzer][NFC] Introduce SVal::isa

2022-05-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp:44 // Uninitialized value used for the mutex? - if (V.getAs()) { + if (V.isa()) { if (ExplodedNode *N = C.generateErrorNode()) { xazax.hun wrote: > Is th

[PATCH] D125209: [clang-tidy] modernize-deprecated-headers check should respect extern "C" blocks

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430295. steakhal marked an inline comment as done. steakhal added a comment. - Move all the `details` stuff into an anonymous namespace. - Pass the `std::vector &IncludesToBeProcessed` directly to the callbacks. - Sink the `IncludeMarker` definition into the

[PATCH] D125769: [clang-tidy] Introduce the WarnIntoHeaders option to modernize-deprecated-headers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430297. steakhal added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125769/new/ https://reviews.llvm.org/D125769 Files: clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp

[PATCH] D125209: [clang-tidy] modernize-deprecated-headers check should respect extern "C" blocks

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked an inline comment as done. steakhal added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp:90 + // to the `ASTContext`. + Finder->addMatcher(ast_matchers::translationUnitDecl().bind("TU"), this); +}

[PATCH] D125769: [clang-tidy] Introduce the CheckHeaderFile option to modernize-deprecated-headers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430303. steakhal retitled this revision from "[clang-tidy] Introduce the WarnIntoHeaders option to modernize-deprecated-headers" to "[clang-tidy] Introduce the CheckHeaderFile option to modernize-deprecated-headers". steakhal edited the summary of this revis

[PATCH] D125769: [clang-tidy] Introduce the CheckHeaderFile option to modernize-deprecated-headers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp:2-4 // Copy the 'mylib.h' to a directory under the build directory. This is // required, since the relative order of the emitted diagnostics depends

[PATCH] D125770: [clang-tidy] modernize-deprecated-headers should ignore system headers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430305. steakhal marked an inline comment as done. steakhal retitled this revision from "[clang-tidy] modernize-deprecated-headers should ignore system headers" to "[clang-tidy] modernize-deprecated-headers should ignore system headers". steakhal added a co

[PATCH] D125770: [clang-tidy] modernize-deprecated-headers should ignore system headers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp:37 -#include // FIXME: We should have no warning into system headers. -// CHECK-MESSAGES-WARN-INTO-HEADERS: mysystemlib.h:1:10: warning: inclusion

[PATCH] D124244: [analyzer] add StoreToImmutable and ModelConstQualifiedReturn checkers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I found this report at `vim/src/term.c` (https://github.com/vim/vim.git at `v8.2.1920`): F23102904: image.png I'm not sure what the exact type of `BC` global variable is but I think it's declared as either `extern char *BC;` or just

[PATCH] D125749: [analyzer][NFC] Introduce SVal::isa

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430326. steakhal marked an inline comment as done. steakhal edited the summary of this revision. steakhal added a comment. - Prefer `V.isUndef()` to `V.isa()`. - Remove tautologically true assertions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D125709: [analyzer][Casting] Support isa, cast, dyn_cast of SVals

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430327. steakhal added a comment. - Added uses for `dyn_cast` and `cast` of the new specialization. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125709/new/ https://reviews.llvm.org/D125709 Files: clang/in

[PATCH] D125709: [analyzer][Casting] Support isa, cast, dyn_cast of SVals

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D125709#3519850 , @xazax.hun wrote: > While not having tests might be OK, but I'd prefer to introduce at least a > couple uses of the new facilities so existing tests cover them. I've added a use of the new `dyn_cast` and `c

[PATCH] D125871: [analyzer] Delete alpha.deadcode.UnreachableCode checker

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp:53-54 - - if (Eng.hasWorkRemaining()) -return; - I thought this check guards this checker to be meaningful. @martong Repository: rG LLVM Github Monor

[PATCH] D125871: [analyzer] Delete alpha.deadcode.UnreachableCode checker

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Could you please give a few examples of these FPs for the record? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125871/new/ https://reviews.llvm.org/D125871 ___ cfe-commits mail

[PATCH] D125770: [clang-tidy] modernize-deprecated-headers should ignore system headers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp:37 -#include // FIXME: We should have no warning into system headers. -// CHECK-MESSAGES-WARN-INTO-HEADERS: mysystemlib.h:1:10: warning: inclusion

[PATCH] D125770: [clang-tidy] modernize-deprecated-headers should ignore system headers

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 2 inline comments as done. steakhal added a comment. Thanks for the review @LegalizeAdulthood! Can I consider this change accepted? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125770/new/ https://reviews.llvm.org/D125770

[PATCH] D125892: [analyzer] Implement assumeInclusiveRange in terms of assumeInclusiveRangeDual

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Okay, it took me a while to get what's going on. Do you have anything in mind to express it by slightly less indirection, references, templates and well, virtual functions xD Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D125920: [analyzer][NFC] Remove the unused LocAsInteger::getPersistentLoc()

2022-05-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D125892: [analyzer] Implement assumeInclusiveRange in terms of assumeInclusiveRangeDual

2022-05-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Now I see, the summary confused me. > This includes the refactoring of the common assumle*Dual logic into the > function template assumeDualImpl. I felt like this is a refactoring change, but it was not. It's about fixing the behavior by using the `cloneAsPosteriorlyOv

[PATCH] D125954: [analyzer][NFC] Factor out the copy-paste code repetition of assumeDual and assumeInclusiveRangeDual

2022-05-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. Okay, it still looks a bit odd, but this is definitely an increment. Comment at: clang/lib/StaticAnalyzer/Core/ConstraintManager.cpp:48 +ConstraintManager::assumeDualImpl

[PATCH] D126067: [analyzer] Drop the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, Szelethus. Herald added subscribers: carlosgalvezp, manas, ASDenysPetrov, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. steakhal requested review

[PATCH] D125920: [analyzer][NFC] Remove the unused LocAsInteger::getPersistentLoc()

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D125920#3524586 , @martong wrote: > LGTM. Are there any other `getPersistentLoc` function definitions in other > SVals? Might they be also unused? IDK, might be. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D125920: [analyzer][NFC] Remove the unused LocAsInteger::getPersistentLoc()

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5450db5f54b8: [analyzer][NFC] Remove the unused LocAsInteger::getPersistentLoc() (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125920

[PATCH] D125209: [clang-tidy] modernize-deprecated-headers check should respect extern "C" blocks

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked an inline comment as done. steakhal added a comment. WDYT, are there any blocker issues with this patch stack? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125209/new/ https://reviews.llvm.org/D125209 _

[PATCH] D125749: [analyzer][NFC] Introduce SVal::isa

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. There is one minor problem with this patch. At `SVal` member function's context one needs to call `llvm::isa<...>()` with by the qualified name, otherwise, the `isa` is ambiguous. The compiler won't know if we want to refer to the free-function or the variadic member f

[PATCH] D126068: [llvm][clang][bolt][NFC] Use llvm::less_first() when applicable

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: aaron.ballman, lattner. Herald added subscribers: ayermolo, jdoerfert, martong, mgrang, hiraditya. Herald added a reviewer: JDevlieghere. Herald added a reviewer: jhenderson. Herald added a reviewer: Szelethus. Herald added a reviewer: rafau

[PATCH] D126067: [analyzer] Drop the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 430978. steakhal added a comment. Mention this removal in the release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126067/new/ https://reviews.llvm.org/D126067 Files: clang-tools-extra/clang-tidy/Cl

[PATCH] D125209: [clang-tidy] modernize-deprecated-headers check should respect extern "C" blocks

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG665bfbb98daa: Reland "[clang-tidy] modernize-deprecated-headers check should respect extern… (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D125771: [clang-tidy] Add a useful note about -std=c++11-or-later

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431028. steakhal marked 2 inline comments as done. steakhal added a comment. Generalized the flag help text to all supported standard versions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125771/new/ https:/

[PATCH] D125769: [clang-tidy] Introduce the CheckHeaderFile option to modernize-deprecated-headers

2022-05-20 Thread Balázs Benics via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. steakhal marked an inline comment as done. Closed by commit rG0606467ea122: [clang-tidy] Introduce the WarnIntoHeaders option to modernize-deprecated… (authored by stea

[PATCH] D125770: [clang-tidy] modernize-deprecated-headers should ignore system headers

2022-05-20 Thread Balázs Benics 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 rG6fa82e344c29: [clang-tidy] modernize-deprecated-headers should ignore system headers (authored by steakhal). Repository: rG LLVM Github Monorepo

[PATCH] D125771: [clang-tidy] Add a useful note about -std=c++11-or-later

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431141. steakhal marked an inline comment as done. steakhal added a comment. Make the note more precise. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125771/new/ https://reviews.llvm.org/D125771 Files: cla

[PATCH] D125771: [clang-tidy] Add a useful note about -std=c++11-or-later

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/test/clang-tidy/check_clang_tidy.py:31 + -std=c++(98|11|14|17|20)[-or-later]: +This flag will cause multiple runs within the same check_clang_tidy +execution. Make sure you don't have shared state across these

[PATCH] D126123: [analyzer][NFC] MemRegion::getRegion() never returns null

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. Herald added subscribers: manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steakhal requested review of this revision. He

[PATCH] D126123: [analyzer][NFC] MemRegion::getRegion() never returns null

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431155. steakhal added a comment. `arc` used the HEAD^ as base, so I'm setting the parent patches now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126123/new/ https://reviews.llvm.org/D126123 Files: clang

[PATCH] D126124: [analyzer][NFC] Inline ExprEngine::evalComplement

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126125: [analyzer][NFC] Inline ExprEngine::evalMinus

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126126: [analyzer][NFC] Inline and simplify nonloc::ConcreteInt functions

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126127: [analyzer][NFC] Relocate unary transfer functions

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126128: [analyzer][NFC] Inline loc::ConcreteInt::evalBinOp

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126129: [analyzer][NFC] Remove unused nonloc::ConcreteInt::evalBinOp

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126130: [analyzer][NFC] Remove unused SVal::hasConjuredSymbol

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126130: [analyzer][NFC] Remove unused SVal::hasConjuredSymbol

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431164. steakhal added a comment. Well, my first use of `arc` went a bit sideways, so I'm falling back to posting this NFC patch batch manually. We will see how using `arc` works out next time. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D126123: [analyzer][NFC] MemRegion::getRegion() never returns null

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431168. steakhal added reviewers: NoQ, martong. steakhal added a comment. Herald added a subscriber: rnkovacs. Well, my first use of arc went a bit sideways, so I'm falling back to posting this NFC patch batch manually. We will see how using arc works out ne

[PATCH] D125771: [clang-tidy] Add a useful note about -std=c++11-or-later

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Thanks for the review, sorry about the mistakes I made on this trivial change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125771/new/ https://reviews.llvm.org/D125771 ___ cfe

[PATCH] D125771: [clang-tidy] Add a useful note about -std=c++11-or-later

2022-05-21 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGecf5924eb4c4: [clang-tidy] Add a useful note about -std=c++11-or-later (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125771/new/ htt

[PATCH] D126123: [analyzer][NFC] MemRegion::getRegion() never returns null

2022-05-22 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Until this point, the runtime and reports of the Clang Static Analyzer did not change on our testset; which confirms that the stack is indeed NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126123/new/ https://reviews.

[PATCH] D126186: [clang-tidy] Extend cert-oop57-cpp to check non-zero memset values

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added reviewers: njames93, aaron.ballman, alexfh. steakhal added a comment. Looks reasonable to me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126186/new/ https://reviews.llvm.org/D126186 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D126186: [clang-tidy] Extend cert-oop57-cpp to check non-zero memset values

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D126186#3530967 , @gamesh411 wrote: > Was there a certificate change on the reviews.llmv.org site maybe?) Yes, AFAIK. Please redo the measurement, it doesn't look right. F23164509: image.png

[PATCH] D126198: [analyzer][NFCi] Annotate major nonnull returning functions

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, Szelethus. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. steakhal requested review of this revisio

[PATCH] D126198: [analyzer][NFCi] Annotate major nonnull returning functions

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431343. steakhal added a comment. fix typo `migth` -> `might` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126198/new/ https://reviews.llvm.org/D126198 Files: clang/include/clang/Analysis/AnalysisDeclConte

[PATCH] D126123: [analyzer][NFC] MemRegion::getRegion() never returns null

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D126123#3531112 , @martong wrote: > Is it documented with `getRegion`? Could we decorate that with > `returns-nonnull` > https://clang.llvm.org/docs/AttributeReference.html#returns-nonnull ? Ah, I thought one of my changes

[PATCH] D126130: [analyzer][NFC] Remove unused SVal::hasConjuredSymbol

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431344. steakhal added a comment. upload the right diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126130/new/ https://reviews.llvm.org/D126130 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitiv

[PATCH] D126130: [analyzer][NFC] Remove unused SVal::hasConjuredSymbol

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D126130#3531108 , @martong wrote: >> Remove unused SVal::hasConjuredSymbol > > The title seems to be off with the changes. Ah, right. Once I tried using `arc`, and I get everything messed up. Never again! Repository: rG

[PATCH] D126126: [analyzer][NFC] Inline and simplify nonloc::ConcreteInt functions

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal abandoned this revision. steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:90 -SVal SimpleSValBuilder::evalMinus(NonLoc val) { - switch (val.getSubKind()) { - case nonloc::ConcreteIntKind: martong wrote: >

[PATCH] D126198: [analyzer][NFCi] Annotate major nonnull returning functions

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/include/clang/Analysis/AnalysisDeclContext.h:233 + : Kind(k), Ctx(ctx), Parent(parent), ID(ID) { +assert(Ctx); + } martong wrote: > To be consistent with the other hunks, where you assert on the paramete

[PATCH] D126127: [analyzer][NFC] Relocate unary transfer functions

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431354. steakhal added a comment. Pull out of the original patch stack Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126127/new/ https://reviews.llvm.org/D126127 Files: clang/include/clang/StaticAnalyzer/Co

[PATCH] D126198: [analyzer][NFCi] Annotate major nonnull returning functions

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431379. steakhal marked an inline comment as done. steakhal added a comment. `assert(ctx)` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126198/new/ https://reviews.llvm.org/D126198 Files: clang/include/cla

[PATCH] D126215: [analyzer] Deprecate `-analyzer-store region` flag

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126216: [analyzer][NFC] Remove unused RegionStoreFeatures

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126215: [analyzer] Deprecate `-analyzer-store region` flag

2022-05-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal planned changes to this revision. steakhal added a comment. In D126215#3531780 , @martong wrote: >> We should support deprecated analyzer flags for at least one release. In >> this case I'm planning to drop this flag in clang-17 > > Should we em

[PATCH] D126215: [analyzer] Deprecate `-analyzer-store region` flag

2022-05-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 431618. steakhal edited the summary of this revision. steakhal added a comment. Herald added a subscriber: MaskRay. - Emit a warning when passing this option. - State explicitly in the release notes that passing this option to `clang-17` and above will cause

[PATCH] D126215: [analyzer] Deprecate `-analyzer-store region` flag

2022-05-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. @NoQ, please have a look at this. Comment at: clang/test/Analysis/deprecated-flags-and-options.cpp:1-13 +// RUN: %clang_analyze_cc1 -analyzer-checker=core %s 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK + +// RUN: %clang_analyze_cc1 -analyzer-

[PATCH] D126197: [analyzer] SATest: Weaken assumption about HTML files

2022-05-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. I'm not using this script file, so I'm not gonna be too picky about this. However, I would be more confident landing changes if we had tests exercising the changed behavior. If you plan to

[PATCH] D126196: [analyzer] SATest: Ensure Docker image can be built

2022-05-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. LGTM; So you have used this tool. Could you add some notes somewhere on how to get this to work? What is the workflow? Is it documented anywhere? I know that's an unrelated topic, but I mi

[PATCH] D126281: [analyzer] Fix symbol simplification assertion failure

2022-05-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D126281#3533755 , @martong wrote: >> Point 2) above has negligible performance impact, empirical measurements do >> not show any noticeable difference in the run-time. > > Attaching the measurement results that show the run-t

[PATCH] D125400: [clang][Analyzer] Add errno state to standard functions modeling.

2022-05-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:412 + class ZeroRelatedErrnoConstraint : public ErrnoConstraintKind { +clang::BinaryOperatorKind Relation; + The explicit qualification is not necess

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, krememek, Szelethus, baloghadamsoftware. Herald added subscribers: cfe-commits, Charusso, donat.nagy, dexonsmith, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. Herald added a project: clang. Enables the users to

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 3 inline comments as done. steakhal added a comment. Thank you for your response @Szelethus. Fixed, updating the patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66733/new/ https://reviews.llvm.org/D66733

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 217162. steakhal added a comment. Reformatted using `clang-format-diff.py`. Minor fixes which were requested by @Szelethus. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66733/new/ https://reviews.llvm.org/D66733 Files: clang/docs/analyzer/check

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 217164. steakhal added a comment. Fix copy-paste mistake. This time upload the correct version. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66733/new/ https://reviews.llvm.org/D66733 Files: clang/docs/analyzer/checkers.rst clang/include/clan

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. @NoQ What do you think, should it be under a flag (as it would be now), or enabled by default? I think these warnings are valuable and we should consider it enabling by default. An interesting fact is that previously rGf224820b45c6847b91071da8d7ade59f373b96f3

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. @Szelethus Your catch with the mispositioned report message

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. @Szelethus The mispositioned report message was my fault. I used a different version of clang for the analysis and to upload the results, which resulted in some mispositioned reports. I've fixed the linked CodeChecker instance. CHANGES SINCE LAST ACTION https://revi

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-28 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 2 inline comments as done. steakhal added a comment. Fixes for @NoQ's comments. I will update the patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66733/new/ https://reviews.llvm.org/D66733 ___ cfe-commits mailing list c

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-08-28 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 217665. steakhal added a comment. Changes: - Flag option marked as 'enabled by default'. - Reformat all the test cases for C, C++ and Obj C. - Now uses `-verify=tags` approach. - Fixes checker documentation. CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D59637: [analyzer] Use the custom propagation rules and sinks in GenericTaintChecker

2019-09-05 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:191 static TaintPropagationRule -getTaintPropagationRule(const FunctionDecl *FDecl, StringRef Name, +getTaintPropagationRule(const GenericTaintChecker *Checker, +

[PATCH] D59637: [analyzer] Use the custom propagation rules and sinks in GenericTaintChecker

2019-09-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:118 /// Check for CWE-134: Uncontrolled Format String. - static const char MsgUncontrolledFormatString[]; + static constexpr llvm::StringLiteral MsgUncontrolledFormatString = +

[PATCH] D72035: [analyzer][NFC] Use CallEvent checker callback in GenericTaintChecker

2019-12-31 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, Szelethus, boga95. steakhal added a project: clang. Herald added subscribers: cfe-commits, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun, whisperity. steakhal added a parent revision: D

[PATCH] D72035: [analyzer][NFC] Use CallEvent checker callback in GenericTaintChecker

2019-12-31 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:385 +unsigned getNumArgs(const CallEvent &Call) { + return Call.getNumArgs() + static_cast(isa(Call)); } I'm not sure why should we adjust (//workaround//) the

[PATCH] D87004: [analyzer] Evaluate PredefinedExpressions

2020-09-13 Thread Balázs Benics via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. steakhal marked an inline comment as done. Closed by commit rG163863604f9c: [analyzer] Evaluate PredefinedExpressions (authored by steakhal). Repository: rG LLVM Git

[PATCH] D86223: [analyzer][z3] Use more elaborate Z3 variable names

2020-09-13 Thread Balázs Benics 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 rGcdacffe4acc0: [analyzer][z3] Use more elaborate Z3 variable names (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D87785: [analyzer][StdLibraryFunctionsChecker] Fix a BufferSize constraint crash

2020-09-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:219-226 if (V.isUndef()) -return State; +return {State, State}; DefinedOrUnknownSVal L = V.castAs(); if (!L.getAs()) -retur

[PATCH] D71524: [analyzer] Support tainted objects in GenericTaintChecker

2020-09-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D71524#2284386 , @Szelethus wrote: > I figured you're still working on this, sorry! I'd really like to chat about > my earlier comment D71524#1917251 , > as it kind of challenges the h

[PATCH] D77062: [analyzer] Improve zero assumption in CStringChecke::assumeZero

2020-09-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D77062#1976414 , @Szelethus wrote: > I think what what be great to see here (and this seems to be the thing @NoQ > is fishing for) is not to change an if branch and avoid running into the > crash, but rather find out why `ass

[PATCH] D88019: [analyzer][solver] Fix issue with symbol non-equality tracking

2020-09-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. What are our options mitigating anything similar happening in the future? This way any change touching the `SymbolicRangeInferrer` and any related parts of the analyzer seems to be way too fragile. Especially, since we might want to add support for comparing SymSyms, ju

[PATCH] D86295: [analyzer] Reorder the layout of MemRegion and cache by hand for optimal size

2020-09-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Should I create more measurements? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86295/new/ https://reviews.llvm.org/D86295 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[PATCH] D77062: [analyzer] Improve zero assumption in CStringChecke::assumeZero

2020-09-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Finally, I made my investigations and I come up with this code: void strcpy(char *, char *); void test(int *a, char ***b) { *(unsigned char **)b = (unsigned char*)a; // #1 if (**b == nullptr) // will-crash ; } So, this issue does not relate to CStrin

[PATCH] D77062: [analyzer] Improve zero assumption in CStringChecke::assumeZero

2020-09-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. And of course, repro: ./bin/clang -cc1 -analyze -setup-static-analyzer -analyzer-checker=core example.c Assertion `op == BO_Add' failed #0 0x7f5bea743904 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/elnbbea/git/llvm-project/build/debug/../

[PATCH] D77062: [analyzer] Improve zero assumption in CStringChecke::assumeZero

2020-09-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D77062#2294516 , @martong wrote: > Though, the fix probably will not be simple, because the issue itself always > requires a 3x indirection. The code that is presented by @steakhal is the > least minimal example to get this c

[PATCH] D88019: [analyzer][solver] Fix issue with symbol non-equality tracking

2020-09-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D88019#2291953 , @steakhal wrote: > What are our options mitigating anything similar happening in the future? > > This way any change touching the `SymbolicRangeInferrer` and any related > parts of the analyzer seems to be way

[PATCH] D88359: [analyzer][RFC] Complete rewrite of ArrayBoundCheckerV2

2020-09-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, vsavchenko, xazax.hun, Szelethus, martong, balazske, baloghadamsoftware. Herald added subscribers: cfe-commits, ASDenysPetrov, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, whisperity. Herald added a proj

[PATCH] D88359: [analyzer][RFC] Complete rewrite of ArrayBoundCheckerV2

2020-09-28 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D88359#2297074 , @NoQ wrote: > So, `ArrayBoundCheckerV3` then? :D > We already have a similar simplification facility in `SValBuilder` created to > solve the similar problem with iterator checkers. It fires up when it knows

[PATCH] D86223: [analyzer][z3] Use more elaborate z3 variable names in debug build

2020-08-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, Szelethus, vsavchenko, xazax.hun, mikhail.ramalho, ddcc. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity. Herald added a project:

[PATCH] D86223: [analyzer][z3] Use more elaborate z3 variable names in debug build

2020-08-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D86223#2226630 , @xazax.hun wrote: > I wonder whether having a virtual method for symbols to get the prefix would > be cleaner (something like getKindCStr), but I do not insist. Are you implying to have something like: vir

[PATCH] D86223: [analyzer][z3] Use more elaborate z3 variable names in debug build

2020-08-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D86223#2226876 , @xazax.hun wrote: > Exactly, but you could return a StringRef to static storage. > > I am fine with both approach. Whichever you find cleaner. Eh, I'm not sure if it worth it to put these into virtual function

[PATCH] D86295: [analyzer] Reorder the the layout of MemRegion and cache by hand for optimal size

2020-08-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, xazax.hun, Szelethus, vsavchenko, ASDenysPetrov. Herald added subscribers: cfe-commits, martong, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity. Herald added a project: clang.

[PATCH] D86223: [analyzer][z3] Use more elaborate z3 variable names in debug build

2020-08-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D86223#2228731 , @xazax.hun wrote: > In D86223#2227353 , @steakhal wrote: > >> Eh, I'm not sure if it worth it to put these into virtual functions - as >> conditionally overriding funct

<    1   2   3   4   5   6   7   8   9   10   >