[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-08-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 109117. baloghadamsoftware added a comment. Overflow scenarios skipped. https://reviews.llvm.org/D35109 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/svalbuilder-rearrange-comparisons.c Index: test/Analysis/svalbuilder-r

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2017-08-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 109126. baloghadamsoftware added a comment. Herald added a subscriber: JDevlieghere. Test changed. I made some bad throws reachable, but the frontend check still does detects them. https://reviews.llvm.org/D33537 Files: clang-tidy/misc/CMakeLi

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-08-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. What do you suggest? Should we widen the type of the difference, or abandon this patch and revert back to the local solution I originally used in the iterator checker? https://reviews.llvm.org/D35109 ___ cfe-com

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238192. baloghadamsoftware retitled this revision from "[clang-tidy][WIP] New check readability-prefer-initialization-list" to "[clang-tidy][WIP] New check cppcoreguidelines-prefer-initialization-list". baloghadamsoftware added a comment. Herald ad

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238219. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.tx

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 6 inline comments as done. baloghadamsoftware added a comment. Thank you for the comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:70 +- The 'readability-prefer-member-initializer' check was renamed to :doc:`cppcoreguidelines-prefer-memb

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238449. baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/cppc

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: klimek, sbenza. baloghadamsoftware added a project: clang. Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs. baloghadamsoftware requested review of this revision. //AST Matcher// `hasBody` is a p

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. It looks like it was not entirely my fault: D87527 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 ___

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D87527#2268348 , @whisperity wrote: > What about http://clang.llvm.org/doxygen/classclang_1_1CXXConversionDecl.html > ? That is part of "etc.". It works for all current and future descendants of `FunctionDecl` now.

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D87527#2270939 , @ymandel wrote: > Can you expand on what is wrong currently for `FunctionDecl` descendants? > Would the new test `FindsBodyOfFunctionChildren` fail with the current > implementation? Yes, exactly.

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. > Thank you for clarifying. I might nitpick that it's not "obviously wrong": > I'm actually writing code now that depends on exactly that behavior -- I > don't care where the method decl body is, as long as it's visible in the > current TU. That said, I thin

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 291562. baloghadamsoftware added a comment. No crash, no hang, no false positives on the LLVM Project. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/cppcore

[PATCH] D87683: [clang-tidy] Crash fix for bugprone-misplaced-pointer-arithmetic-in-alloc

2020-09-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: gribozavr2, aaron.ballman. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: martong, steakhal, gamesh411, Szelethus, dkrupp, rnkovacs, xazax.hun, whisperity. Herald added a project: clang.

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 291901. baloghadamsoftware added a comment. Created another matcher `hasAnyBody`, and updated the documentation of the matchers. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87527/new/ https://reviews.llvm.org/D87527 Files: clang/inc

[PATCH] D87683: [clang-tidy] Crash fix for bugprone-misplaced-pointer-arithmetic-in-alloc

2020-09-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D87683#2274569 , @njames93 wrote: > Please fix the test case first, can't call `operator new(unsigned long, > void*)` with an argument of type `void*` > The other failures the pre merge bot detected can safely be dis

[PATCH] D87683: [clang-tidy] Crash fix for bugprone-misplaced-pointer-arithmetic-in-alloc

2020-09-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 292151. baloghadamsoftware added a comment. `std::size_t` defined correctly in the tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87683/new/ https://reviews.llvm.org/D87683 Files: clang-tools-extra/clang-tidy/bugprone/MisplacedP

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 292170. baloghadamsoftware added a comment. Checker `modernize-use-equals-delete` adjusted. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87527/new/ https://reviews.llvm.org/D87527 Files: clang-tools-extra/clang-tidy/modernize/UseEqual

[PATCH] D87683: [clang-tidy] Crash fix for bugprone-misplaced-pointer-arithmetic-in-alloc

2020-09-16 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG779a2a2edcea: [clang-tidy] Crash fix for bugprone-misplaced-pointer-arithmetic-in-alloc (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-16 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdbd45b2db8e0: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl` (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D77792: [analyzer] Extend constraint manager to be able to compare simple SymSymExprs

2020-09-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware commandeered this revision. baloghadamsoftware edited reviewers, added: steakhal; removed: baloghadamsoftware. baloghadamsoftware added a comment. Herald added a subscriber: gamesh411. We found use cases which can be solved using this improvement. That is why I commandeer this

[PATCH] D77792: [analyzer] Extend constraint manager to be able to compare simple SymSymExprs

2020-09-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 292755. baloghadamsoftware added a comment. Crash fixed and new tests added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77792/new/ https://reviews.llvm.org/D77792 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedC

[PATCH] D77792: [analyzer] Extend constraint manager to be able to compare simple SymSymExprs

2020-09-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:814 +Optional RangeConstraintManager::tryAssumeSymSymOp( +ProgramStateRef State, BinaryOperator::Opcode Op, SymbolRef LHSSym, NoQ wrote: > I belie

[PATCH] D77792: [analyzer] Extend constraint manager to be able to compare simple SymSymExprs

2020-09-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:103-110 + enum class CompareResult { +unknown, +identical, +less, +less_equal, +greater, +greater_equal

[PATCH] D81272: [clang-tidy] New check `bugprone-redundant-branch-condition`

2020-09-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D81272#2276342 , @sylvestre.ledru wrote: > Thanks for this checker. FYI, it found (at least) 3 defects in Firefox code > (fixed with the autofix): > https://hg.mozilla.org/mozilla-central/rev/651e68f628d0 > > https:

[PATCH] D77792: [analyzer] Extend constraint manager to be able to compare simple SymSymExprs

2020-09-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 293111. baloghadamsoftware added a comment. Tests updated: some execution paths merged by refactoring assertions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77792/new/ https://reviews.llvm.org/D77792 Files: clang/include/clang/Stat

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 293139. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.tx

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Prerequeisite patch is committed, the check is tested now on the //LLVM Project//. @lebedev.ri, @aaron.ballman can I recommit it? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 __

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-21 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4fc0214a1014: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D76604: [Analyzer] Model `size()` member function of containers

2020-09-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 293183. baloghadamsoftware added a comment. New test cases added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76604/new/ https://reviews.llvm.org/D76604 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/lib/Stati

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Iterator.cpp:330-336 +SVal getReturnIterator(const CallEvent &Call) { + Optional RetValUnderConstr = Call.getReturnValueUnderConstruction(

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Iterator.cpp:330-336 +SVal getReturnIterator(const CallEvent &Call) { + Optional RetValUnderConstr = Call.getReturnValueUnderConstruction(); + if (RetValUnderConstr.hasValue()) +return *

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Iterator.cpp:330-336 +SVal getReturnIterator(const CallEvent &Call) { + Optional RetValUnderConstr = Call.getReturnValueUnderConstruction(); + if (RetValUnderConstr.hasValue()) +return *

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Iterator.cpp:330-336 +SVal getReturnIterator(const CallEvent &Call) { + Optional RetValUnderConstr = Call.getReturnValueUnderConstruction(); + if (RetValUnderConstr.hasValue()) +return *

[PATCH] D88216: [Analyzer] Fix handling of pointer-based iterator increments and decrements

2020-09-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added a reviewer: NoQ. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, w

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Iterator.cpp:330-336 +SVal getReturnIterator(const CallEvent &Call) { + Optional RetValUnderConstr = Call.getReturnValueUnderConstruction(); + if (RetValUnderConstr.hasValue()) +return *

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/Iterator.cpp:330-336 +SVal getReturnIterator(const CallEvent &Call) { + Optional RetValUnderConstr = Call.getReturnValueUnderConstruction(); + if (RetValUnderConstr.hasValue()) +return *

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 294156. baloghadamsoftware added a comment. Test coverage was hugely increased by rebasing this patch to D88216 . Two kind of tests failed. This last update addreses them: 1. Handle the assignment operator of iter

[PATCH] D77229: [Analyzer][NFC] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Oh, I think now what do you mean: iterators stored in containers, thus iterators iterating over iterators. Yes, the current working of the checker does not support it because it stores iterator positions for both the prvalues and the glvalues. This is so from

[PATCH] D77229: [Analyzer][NFC] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. @gamesh411, @whisperity, @martong and others, please suggest me new test cases if you think the current ones are not enough. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 ___

[PATCH] D87146: [analyzer] Implement shared semantics checks for XNU functions in PthreadLockChecker

2020-09-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D87146#2294423 , @ASDenysPetrov wrote: > It would be nice if someone had time to look at this. Thanks. I am just looking, but I am not a `pthread` expert. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8714

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-09-25 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. baloghadamsoftware marked an inline comment as done. Closed by commit rGfacad21b2983: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and… (authored by baloghadamsoftware). Changed prior to commi

[PATCH] D87146: [analyzer] Implement shared semantics checks for XNU functions in PthreadLockChecker

2020-09-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D87146#2294514 , @baloghadamsoftware wrote: > In D87146#2294423 , @ASDenysPetrov > wrote: > >> It would be nice if someone had time to look at this. Thanks. > > I am just loo

[PATCH] D87449: [clang-tidy] Add new check for SEI CERT rule SIG30-C.

2020-09-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/cert/SignalHandlerCheck.cpp:31 +static bool isSystemCall(const FunctionDecl *FD) { + // This check does not work with function calls in std namespace. + if (!FD->isGlobal() || FD->isInStdNamespac

[PATCH] D77229: [Analyzer][NFC] Avoid handling of LazyCompundVals in IteratorModeling

2020-09-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Now I completely know what the source of our misunderstanding is. You thought that this patch will **fix** an issue, namely that we store iterator positions for both the iterator values and the locations of the iterator variables. While this is definitely a w

[PATCH] D87519: [analyzer][Liveness][NFC] Enqueue the CFGBlocks post-order

2020-09-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/Analysis/LiveVariables.cpp:522 - // FIXME: we should enqueue using post order. - for (const CFGBlock *B : cfg->nodes()) { + for (const CFGBlock *B : *AC.getAnalysis()) { worklist.enqueueBlock(B); --

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-08-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Herald added a subscriber: danielkiss. In D85351#2215547 , @Szelethus wrote: > Shouldn't we create a new test care for this, instead of expanding an > existing one? Btw, this looks great, but I lack the confidence to ac

[PATCH] D81272: [clang-tidy] New check `bugprone-redundant-branch-condition`

2020-08-31 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG14dd0737822b: [Clang-Tidy] New check `bugprone-redundant-branch-condition` (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D81272?vs=285656&id=288940#toc Repository:

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-08-31 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf5fd7486d6c0: [clang-tidy] New check readability-prefer-member-initializer (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D71199?vs=285657&id=288939#toc Repository:

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-09-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D85351#2247095 , @Szelethus wrote: > I think its a bad experience if you break something while developing. Instead > of getting a test failure for "delegating constructor initializers", you'll > have to deal with a

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-09-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. @NoQ could you please take a look on this short fix? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85351/new/ https://reviews.llvm.org/D85351 ___ cfe-commits mailing l

[PATCH] D86743: [analyzer] Ignore VLASizeChecker case that could cause crash

2020-09-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I agree here with @Szelethus. We should investigate first why the assumption fails. Then we can decide about the best possible fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86743/new/ https://reviews.llvm.o

[PATCH] D86874: [analyzer] Fix ArrayBoundCheckerV2 false positive regarding size_t indexer

2020-09-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp:226 + // No unsigned symbolic value can be less then a negative constant. + if (const auto SymbolicRoot = RootNonLoc.getAs()) +if (SymbolicRoot->getSymbol()->getT

[PATCH] D85728: [Analyzer] Support for the new variadic isa<> and isa_and_not_null<> in CastValueChecker

2020-09-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I was indeed on vacation, so thanks for committing it, @NoQ! I was waiting for agreement for the prerequisite patch then I forgot to notify you that I was going on vacation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-09-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 289703. baloghadamsoftware added a comment. Tests separated. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85351/new/ https://reviews.llvm.org/D85351 Files: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp clang/unittests/StaticAnalyz

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-09-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 289981. baloghadamsoftware added a comment. `isIterator()` updated because it did not work perfectly with the refactored `handleBegin()` after rebase. (Why did it work before the rebase?) The problem was that it only looked for the necessary opera

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-09-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 290248. baloghadamsoftware added a comment. Wrong diff uploaded previously. (Accidentally compared to //master// instead of the prerequisite.) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76590/new/ https://reviews.llvm.org/D76590 File

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-09-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:36 + void handleAssignment(CheckerContext &C, const Expr *CE, SVal Cont, +Optional = None) c

[PATCH] D76604: [Analyzer] Model `size()` member function of containers

2020-09-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 290413. baloghadamsoftware added a comment. Fixes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76604/new/ https://reviews.llvm.org/D76604 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/lib/StaticAnalyzer/Check

[PATCH] D76604: [Analyzer] Model `size()` member function of containers

2020-09-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:456 + SVal RetVal) const { + const auto *ContReg = Cont.getAsRegion(); + if (!ContReg) Szelethus wrote: > martong wro

[PATCH] D87388: [Analyzer] Model default constructors of containers

2020-09-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, vsavchenko, gamesh411. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, martong, steakhal, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xa

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 290917. baloghadamsoftware added a comment. Fix for base constructors, test extended. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85351/new/ https://reviews.llvm.org/D85351 Files: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp cla

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:138-139 SVal ThisVal = State->getSVal(ThisPtr); + if (Init->isBaseInitializer() || Init->isDelegatingInitializer(

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71199#2265594 , @lebedev.ri wrote: > So i've just reverted this in rGebf496d805521b53022a351f35854de977fee844 > . > > @aaron.ballman @baloghadamso

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 290967. baloghadamsoftware added a comment. Test added. Thank you for the test @steakhal! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85424/new/ https://reviews.llvm.org/D85424 Files: clang/lib/StaticAnalyzer/Checkers/IteratorRangeCh

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D85424#2258886 , @steakhal wrote: > void foo(int x) { > > int uninit; > x - uninit; // will-crash > > } This is not even related to the iterators. We could check first whether `LHS` is an iterator and early exit

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I found the problem: `hasBody()` always returns true if the function has //somewhere// a body. This means that also the `hasBody` matcher matches forward declarations. However, I only need the definition. This far I could not find any method to achieve that:

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. OK, I reversed the matcher expression now, it seems to work, but I will check it on the //LLVM/Clang// codebase first. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 __

[PATCH] D90691: [analyzer] Add new checker for unchecked return value.

2020-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/UncheckedReturnValueChecker.cpp:41 +BugReporter &BR) const { +auto FoundCall = callExpr().bind("call"); +auto CallInCompound = compoundStmt(forEach(FoundCall));

[PATCH] D89380: [clang-tidy] Fix for cppcoreguidelines-prefer-member-initializer to handle classes declared in macros

2020-11-19 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer.cpp:492 + +#define MACRO1 struct InMacro1 { int i; InMacro1() { i = 0; } }; +// CHECK

[PATCH] D86743: [analyzer] Ignore VLASizeChecker case that could cause crash

2020-09-29 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Yes, @NoQ is right. If the constraint manager cannot reason about a value, then then `ProgramState::assume()` will return the same state with the new assumption in the constraints. Whenever `ProgramState::assume()` returns `nullptr` it means that the assumpti

[PATCH] D86743: [analyzer] Ignore VLASizeChecker case that could cause crash

2020-09-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D86743#2303910 , @NoQ wrote: >> The last comment for that bug is D69726 , >> but the bug is not closed to it seems to me that D69726 >> does not sol

[PATCH] D86743: [analyzer] Ignore VLASizeChecker case that could cause crash

2020-09-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. @vabridgers Please try to apply D69726 and check whether it solves this crash! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86743/new/ https://reviews.llvm.org/D86743

[PATCH] D86743: [analyzer] Ignore VLASizeChecker case that could cause crash

2020-09-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware requested changes to this revision. baloghadamsoftware added a comment. This revision now requires changes to proceed. In D86743#2303922 , @NoQ wrote: > One slightly redeeming thing about this crash is that it's assertion-only. > When b

[PATCH] D88831: [clang-tidy] Remove obsolete checker google-runtime-references

2020-10-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, gribozavr2, aaron.ballman. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: martong, Charusso, gamesh411, Szelethus, dkrupp, rnkovacs, xazax.hun, whisperity, mgorny. Herald added a

[PATCH] D88831: [clang-tidy] Remove obsolete checker google-runtime-references

2020-10-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D88831#2311802 , @lebedev.ri wrote: > In D88831#2311800 , @Eugene.Zelenko > wrote: > >> Does this check make sense in content of other style guides? > > I'd +1 to moving it to

[PATCH] D88831: [clang-tidy] Remove obsolete checker google-runtime-references

2020-10-06 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd6c9dc3c17e4: [clang-tidy] Remove obsolete checker google-runtime-references (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D88831?vs=296170&id=296416#toc Repositor

[PATCH] D89380: [clang-tidy] Fix for cppcoreguidelines-prefer-member-initializer to handle classes declared in macros

2020-10-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: aaron.ballman, gribozavr2. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs, kbarton, xazax.hun, whisperity, nemanjai. Herald added a projec

[PATCH] D89380: [clang-tidy] Fix for cppcoreguidelines-prefer-member-initializer to handle classes declared in macros

2020-10-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 299378. baloghadamsoftware added a comment. Tests added, code reformatted. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89380/new/ https://reviews.llvm.org/D89380 Files: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInit

[PATCH] D89380: [clang-tidy] Fix for cppcoreguidelines-prefer-member-initializer to handle classes declared in macros

2020-10-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In D89380#2330076 , @alexfh wrote: > Thanks for the fix! However, I'm not sure it's possible to correctly rewrite > code in all cases where macros are involved. See a

[PATCH] D76510: [analyzer] Change the default output type to PD_TEXT_MINIMAL, error if an output loc is missing for PathDiagConsumers that need it

2020-03-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. This revision is now accepted and ready to land. Basically LGTM, but please wait for @NoQ or someone for the compatibility questions. Comment at: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.c

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, wh

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Supersedes D62688 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76590/new/ https://reviews.llvm.org/D76590 ___ cfe-commits mailing

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:359 State = State->BindExpr(CE, LCtx, RetVal); } Maybe I should move these lines into a sep

[PATCH] D62688: [Analyzer] Iterator Checkers - Model `empty()` method of containers

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Herald added subscribers: ASDenysPetrov, martong, steakhal. Superseded by D76590 . Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62688/new/ https://re

[PATCH] D76604: [Analyzer] Model `size()` member function of containers

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus, martong. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whi

[PATCH] D62724: [Analyzer] Iterator Checkers - Model `size()` method of containers

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Herald added subscribers: ASDenysPetrov, martong, steakhal. Superseded by D76604 . Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62724/new/ https://re

[PATCH] D76604: [Analyzer] Model `size()` member function of containers

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Supersedes D62724 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76604/new/ https://reviews.llvm.org/D76604 ___ cfe-commits mailing

[PATCH] D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. baloghadamsoftware marked 4 inline comments as done. Closed by commit rG60bad941a1c1: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std… (authored by baloghadamsoftware). Repository: rG LLVM Gi

[PATCH] D76509: [analyzer][NFC] Move the text output type to its own file, move code to PathDiagnosticConsumer creator functions

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. Much more logical than the existing setup. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76509/new/ https://reviews.llvm.org/D76509 ___ cfe-commits mailing

[PATCH] D76379: [Analyzer] IteratorRangeChecker verify `std::advance()`, `std::prev()` and `std::next()`

2020-03-23 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGccc0d351817b: [Analyzer] IteratorRangeChecker verify `std::advance()`, `std::prev()` and `std… (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D76379?vs=251320&id=252

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 252364. baloghadamsoftware added a comment. Updated according to a comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name = DRE->getDecl()->ge

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 252519. baloghadamsoftware added a comment. Test added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/lib/StaticAnalyzer/

[PATCH] D74541: [Analyzer] Use note tags to track iterator increments and decrements

2020-03-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/test/Analysis/iterator-modelling.cpp:434 + //expected-note@-1 0-1{{Calling 'next}} + //expected-note@-2 0-1{{Passing the value 1 via 2nd parameter 'n'}} + //expecte

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-26 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa3f4d17a1a53: [Analyzer] Use note tags to track container begin and and changes (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-26 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1a27d63a8891: [Analyzer] Only add container note tags to the operations of the affected… (authored by baloghadamsoftware). Herald added a subscriber: ASDenysPetrov. Changed prior to commit: https://revi

[PATCH] D75677: [Analyzer] Only add iterator note tags to the operations of the affected iterators

2020-03-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:541-542 +BR.markInteresting(It1); +if (const auto &LCV1 = It1.getAs()) { + BR.markInteresting

[PATCH] D75677: [Analyzer] Only add iterator note tags to the operations of the affected iterators

2020-03-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:541-542 +BR.markInteresting(It1); +if (const auto &LCV1 = It1.getAs()) { + BR.markInteresting

[PATCH] D75677: [Analyzer] Only add iterator note tags to the operations of the affected iterators

2020-03-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:541-542 +BR.markInteresting(It1); +if (const auto &LCV1 = It1.getAs()) { + BR.markInteresting

<    2   3   4   5   6   7   8   9   10   >