[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:511 + SSE->getLHS()->getType()->isSignedIntegerOrEnumerationType() || + SSE->getLHS()->getType()->isPointerType()) { + return negV->Negate(BV, F);

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 107032. baloghadamsoftware added a comment. Rearrangement of unsigned comparison removed (FIXME added). Comment regarding the types of integer constants added. https://reviews.llvm.org/D35109 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cp

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 106627. baloghadamsoftware added a comment. Type selection simplified, FIXME added. https://reviews.llvm.org/D35110 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp test/Analysis/constraint_manager_negate_difference.c test/Analysis

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 106626. baloghadamsoftware added a comment. Difference of unsigned is converted to signed. https://reviews.llvm.org/D35109 Files: include/clang/AST/ASTContext.h lib/AST/ASTContext.cpp lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Ana

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The other possibility is to make the difference signed. https://reviews.llvm.org/D35109 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33333: Emit warning when throw exception in destruct or dealloc functions which has a (possible implicit) noexcept specifier

2017-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tested the latest revision (this fronted patch already included) on my test file in https://reviews.llvm.org/D33537. Disregarding of the (not so important) check-specific parameters (`EnabledFunctions` and `IgnoredExceptions`) I do not get warnings for any

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:511 + SSE->getLHS()->getType()->isSignedIntegerOrEnumerationType() || + SSE->getLHS()->getType()->isPointerType()) { + return negV->Negate(BV, F);

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I think we should exclude unsigned types completely. `A >= B` is converted to `A - B >= 0`, thus the range of `A - B` is `[0 .. INT_MAX]` which is the full range for the unsigned type. This implies that upon any conditional statement `if (A >= B) ...` the ran

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D35109#806156, @NoQ wrote: > I think you might also need to convert `APSInt`s to an appropriate type, as > done above. Type of right-hand-side `APSInt`s do not necessarily coincide > with the type of the left-hand-side symbol or of

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In https://reviews.llvm.org/D35109#801921, @NoQ wrote: > Because integer promotion rules are tricky, could we, for now, avoid dealing > with the situation when left-hand side and right-hand side and the resu

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:583 +newRhs = BasicVals.evalAPSInt(BO_Add, *lInt, *rInt); +reverse = (lop == BO_Add); + } else

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 105628. baloghadamsoftware added a comment. Type check added and restricted to additive operators. https://reviews.llvm.org/D35109 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/std-c-library-functions.c test/Analysis/sv

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

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#771274, @aaron.ballman wrote: > The check in https://reviews.llvm.org/D3 is using a CFG, not just > checking direct throws. I tested the latest revision (the fronted patch already included) on my test file. Disregardin

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 105594. baloghadamsoftware added a comment. Simplified for enhanced SValBuilder and ConstraintManager. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 105593. baloghadamsoftware added a comment. Wrong patch files was uploaded first. https://reviews.llvm.org/D35110 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp test/Analysis/ptr-arith.c Index: test/Analysis/ptr-arith.c ==

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. If range `[m .. n]` is stored for symbolic expression `A - B`, then we can deduce the range for `B - A` which is [-n .. -m]. This is only true for signed types, unless the range is `[0 .. 0]`. https://reviews.llvm.org/D35110 Files: lib/StaticAnalyze

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Since the range-based constraint manager (default) is weak in handling comparisons where symbols are on both sides it is wise to rearrange them to have symbols only on the left side. Thus e.g. `A + n >= B + m` becomes `A - B >= m - n` which enables the

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Now I can improve `SValBuilder` to compare `{conj_X}+n` to `conj_X}+m`, but I am not sure if it helps to simplify `compare()` much. How to handle cases where I have to compare `{conj_X}+n` to `{conj_Y}+m`, an we have a range `[k..k]` for `{conj_X}-{conj_Y}` i

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 103728. baloghadamsoftware added a comment. `SymbolManager::getSymIntExpr()` replaced by `SValBuilder::evalBinOp()`, function `compact()` eliminated. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. > I'm sure that simplification `(($x + N) + M) ~> ($x + (M + N))` is already > working in `SValBuilder`. No, it is unfortunately not working: I tried to increase `${conj_X}` by `1`, then again by `1`, and I got symbolic expression `(${conj_X}+1)+1)`. https:

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-06-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 103568. baloghadamsoftware added a comment. Minor fixes according to the comments. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h test/Analysis/diagn

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-06-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tried `SValBuilder::evalBinOp()` first but it did not help too much. It could decide only if I compared the same conjured symbols or different ones, but nothing more. It always gave me `UnknownVal`. Even if comparing ${conj_X} == ${conj_X} + n where n was a

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-06-19 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any progress in the review? https://reviews.llvm.org/D32642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#770264, @aaron.ballman wrote: > I think we should try to get as much of this functionality in > https://reviews.llvm.org/D3 as possible; there is a considerable amount > of overlap between that functionality and this fun

[PATCH] D19201: [clang-tidy] misc-throw-with-noexcept

2017-05-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. There is a patch (https://reviews.llvm.org/D33537) for a check which is a superset of this: It does not only check for noexcept (and throw()) functions, but also for destructors, move constructors, move assignments, the main() function, swap() functions and a

[PATCH] D31370: [clang-tidy] Prototype to check for exception specification

2017-05-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The matcher in https://reviews.llvm.org/D33537 could be reused here as well. Maybe I should make it common, but it is more complex than any of the common matchers. Repository: rL LLVM https://reviews.llvm.org/D31370

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-05-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100848. baloghadamsoftware added a comment. Rebased to (committed) Part1 (https://reviews.llvm.org/rL304160) and updated according to comments. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analy

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100382. baloghadamsoftware added a comment. Ignoring bad_alloc. https://reviews.llvm.org/D33537 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/ExceptionEscapeCheck.cpp clang-tidy/misc/ExceptionEscapeCheck.h clang-tidy/misc/MiscTidy

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100374. baloghadamsoftware added a comment. Check added to the Release Notes. https://reviews.llvm.org/D33537 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/ExceptionEscapeCheck.cpp clang-tidy/misc/ExceptionEscapeCheck.h clang-tidy

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#764834, @Prazek wrote: > How is that compared to https://reviews.llvm.org/D19201 and the clang patch > mentioned in this patch? Actually, this check does much more. It does not only check for noexcept (and throw()) functio

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100369. baloghadamsoftware added a comment. Docs fixed according to the comments. https://reviews.llvm.org/D33537 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/ExceptionEscapeCheck.cpp clang-tidy/misc/ExceptionEscapeCheck.h clang-

[PATCH] D32592: [Analyzer] Iterator Checker - Part 1: Minimal Checker for a Simple Test Case

2017-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100239. baloghadamsoftware added a comment. Comments added and fixed. https://reviews.llvm.org/D32592 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/IteratorCh

[PATCH] D32592: [Analyzer] Iterator Checker - Part 1: Minimal Checker for a Simple Test Case

2017-05-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any comments regarding the last changes? https://reviews.llvm.org/D32592 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32350: [Analyzer] Exception checker for misuse: uncaught/noncompliant throws

2017-05-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Superseded by https://reviews.llvm.org/D33537 https://reviews.llvm.org/D32350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailm

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

2017-05-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Supersedes https://reviews.llvm.org/D32350 https://reviews.llvm.org/D33537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-05-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: mgorny. Finds functions which should not throw exceptions: Destructors, move constructors, move assignment operators, the main() function, swap() functions, functions marked with throw() or noexcept and functions given as optio

[PATCH] D32592: [Analyzer] Iterator Checker - Part 1: Minimal Checker for a Simple Test Case

2017-05-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D32592#747132, @NoQ wrote: > Then, in methods that deal with iterator `SVal`s directly, i wish we had > hints explaining what's going on in these ~7 cases. In my opinion, that'd > greatly help people understand the code later, and

[PATCH] D32592: [Analyzer] Iterator Checker - Part 1: Minimal Checker for a Simple Test Case

2017-05-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 98275. baloghadamsoftware marked 11 inline comments as done. baloghadamsoftware added a comment. Updated according to the review. https://reviews.llvm.org/D32592 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Chec

[PATCH] D31975: [Analyzer] Iterator Checkers

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Split to 10 parts. https://reviews.llvm.org/D31975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32906: [Analyzer] Iterator Checker - Part 10: Support for iterators passed as parameter

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. check::Bind() is not invoked for parameter passing. We use a trick instead: in checkBeginFunction we copy the positions of iterator parameters from the arguments to the parameters. https://reviews.llvm.org/D32906 Files: lib/StaticAnalyzer/Checkers/I

[PATCH] D32905: [Analyzer] Iterator Checker - Part 9: Evaluation of std::find-like calls

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. This patch adds explicit evaluation of the following functions: std::find, std::find_end, std::find_first_of, std::find_if, std::find_if_not, std::lower_bound, std::upper_bound, std::search and std::search_n. On the one hand this is an optimization sinc

[PATCH] D32904: [Analyzer] Iterator Checker - Part 8: Support for assign, clear, insert, emplace and erase operations

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. This patch adds support for the following operations in the iterator checkers: assign, clear, insert, insert_after, emplace, emplace_after, erase and erase_after. This affects mismatched iterator checks ("this" and parameter must match) and invalidation

[PATCH] D32902: [Analyzer] Iterator Checker - Part 7: Support for push and pop operations

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 97942. baloghadamsoftware added a comment. Wrong diff. https://reviews.llvm.org/D32902 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h test/Analysis/diagnostics/explicit-suppression.

[PATCH] D32860: [Analyzer] Iterator Checker - Part 6: Mismatched iterator checker for constructors and comparisons

2017-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Extension of the mismatched iterator checker for constructors taking range of first..last (first and last must be iterators of the same container) and also for comparisons of iterators of different containers (one does not compare iterators of different

[PATCH] D32859: [Analyzer] Iterator Checker - Part 5: Move Assignment of Containers

2017-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. If a container is moved by its move assignment operator, according to the standard all their iterators except the past-end iterators remain valid but refer to the new container. This patch introduces support for this case in the iterator checkers. htt

[PATCH] D32592: [Analyzer] Iterator Checker - Part1: Minimal Checker for a Simple Test Case

2017-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:211-214 +std::pair +createDifference(SymbolManager &SymMgr, SymbolRef Sym1, SymbolRef Sym2); +const llvm::APSInt *getDifference(ProgramStateRef State, SymbolRef Sym1, +

[PATCH] D32592: [Analyzer] Iterator Checker - Part1: Minimal Checker for a Simple Test Case

2017-04-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 97060. baloghadamsoftware added a comment. Checker and test included now :-) https://reviews.llvm.org/D32592 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Ite

[PATCH] D32592: [Analyzer] Iterator Checker - Part1: Minimal Checker for a Simple Test Case

2017-04-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: mgorny. This is the first part of the new Iterator Checker. This part contains the very core infrastructure. It only checks for out-of-range iterators in a very simple case. https://reviews.llvm.org/D32592 Files: include/c

[PATCH] D31975: [Analyzer] Iterator Checkers

2017-04-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for your help. Actually, I did neither merge the patches nor the checkers. Based on the experiences in the prototype I created a totally new checker. Incremental development sounds good, but I did a lot of experimenting in this particular checker,

[PATCH] D32350: [Analyzer] Exception Checker

2017-04-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: mgorny. This is an old checker used only internally until now. The original author is Bence Babati, I added him as a subscriber. The checker checks whather exceptions escape the main() function, destructors. functions with exc

[PATCH] D31975: [Analyzer] Iterator Checkers

2017-04-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hello! I am not sure how to split it to incremental patches. As I mentioned in the description, the state of the iterator position is always tracked. So if I remove some of the checks it does not make the patch much smaller, since the checking part is quite s

[PATCH] D32164: [clang-tidy] misc-misplaced-widening-cast: Disable checking of implicit widening casts by default

2017-04-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: whisperity. Users reported some false positives using this check. This patch sets the default value of the option for checking implicit widening casts to false. We also suggest renaming the check to something like missing-or-mi

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-04-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Or I can do it for you if you wish. Repository: rL LLVM https://reviews.llvm.org/D31097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-04-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. OK, please create a patch where implicit casts are disabled by default. You can also find a new name for the checker. Repository: rL LLVM https://reviews.llvm.org/D31097 ___ cfe-commits mailing list cfe-commit

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-04-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Whole checker superseeded by https://reviews.llvm.org/D31975. https://reviews.llvm.org/D28771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-04-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Superseeded by patch https://reviews.llvm.org/D31975. https://reviews.llvm.org/D29419 ___ cfe-commits mailing list c

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-03-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hi! There is an option to disable the checking of widening casts. It is enabled by default. You can disable it any time. Or, if you find too much false positives, we can discuss about setting this option to disabled as default. I am convinced that checking i

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-02-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:530 + auto value = RVal; + if (auto loc = value.getAs()) { +value = State->getRawSVal(*loc); NoQ wrote: > baloghadamsoftware wrote: > > NoQ wrote: >

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-02-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 89211. baloghadamsoftware added a comment. checkBind replaces checking of DeclStmt, CXXConstructExpr and assignment operators. Incremention by 0 is not a bug anymore regardless the position of the iterator. https://reviews.llvm.org/D28771 Files

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp:311 + +void MismatchedIteratorChecker::checkPostStmt(const DeclStmt *DS, +

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 89123. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D29419 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Mi

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D29419#671839, @NoQ wrote: > This one looks similar to the `IteratorPastEnd` checker, so much that i'd > definitely advice re-using some code. At the very least, functions like > `isIterator()` should definitely deserve a header so

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-02-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:530 + auto value = RVal; + if (auto loc = value.getAs()) { +value = State->getRawSVal(*loc); NoQ wrote: > baloghadamsoftware wrote: > > NoQ wrote: >

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 86709. baloghadamsoftware added a comment. Herald added a subscriber: mgorny. The checker itself disappeared mystically from the previous diff... https://reviews.llvm.org/D29419 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/Sta

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. A new checker to check whether multiple iterators which should refer to the same container refer to different ones. Here we include comparisons, constructors which take an iterator pair and any template function which takes iterator pair(s). https://r

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-01-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:530 + auto value = RVal; + if (auto loc = value.getAs()) { +value = State->getRawSVal(*loc); NoQ wrote: > Is there a test case for this hack? > > I

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-01-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 86428. baloghadamsoftware added a comment. Updates based on the comments. https://reviews.llvm.org/D28771 Files: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h test/Analysis/diagnos

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D29183#657706, @NoQ wrote: > Hmm, we should have done better work reviewing > https://reviews.llvm.org/D28905. Oh, someone was quicker than me by one week... https://reviews.llvm.org/D29183 ___

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I wonder if this could also be a problem for nested messages in Objective-C, since the call for VisitChildren() is also missing from VisitObjCMessageExpr()... https://reviews.llvm.org/D29183 ___ cfe-commits mail

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Some comments how I found this bug. I got some strange false positives even after the fix for the iterator past end checker (https://reviews.llvm.org/D28771). I could reproduce it with the following code: #include using std::list; using std::prev;

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D29183#657669, @xazax.hun wrote: > Great find! Could you transform your examole into a testcasr that fails > before this patch? I think there should be already some tests for call > graphs that you can take a look at. Yes, but I

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Take the following example: class Int { public: Int(int n = 0): num(n) {} Int(const Int& rhs): num(rhs.num) {} Int& operator=(const Int& rhs) { num = rhs.num; } operator int() { return num; } private: int num; }; templa

[PATCH] D27202: [analyzer] Do not conjure a symbol for return value of a conservatively evaluated function

2017-01-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any progress regarding this patch? Is https://reviews.llvm.org/D26837 necessarily a dependency, or we just need isCompoundType() function? This function could be moved to a separate patch so the dependency could be removed. https://reviews.llvm.org/D27202

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-01-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: zaks.anna, NoQ. baloghadamsoftware added subscribers: xazax.hun, o.gyorgy, cfe-commits. This patch fixes some issues for the IteratorPastEnd checkers. There are basically two main issues this patch targets: one is the h

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D25660#613519, @zaks.anna wrote: > Also, have you evaluated this on real codebases? What results do you see? Are > there any false positives found? Are there any true positives found? I am doing it right now. Unfortunately I found

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 81224. baloghadamsoftware added a comment. Now isInStdNamespace is used. Hack is back so https://reviews.llvm.org/D27202 is not a dependency now. https://reviews.llvm.org/D25660 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/St

[PATCH] D27202: [analyzer] Do not conjure a symbol for return value of a conservatively evaluated function

2016-12-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Could you please remove the IteratorPastEndChecker file differences from this patch and make https://reviews.llvm.org/D25660 dependent on this one? https://reviews.llvm.org/D27202 ___ cfe-commits mailing list cfe

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. https://reviews.llvm.org/D27202 is now a dependency, but cannot add it. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:166 +IteratorPastEndChecker::IteratorPastEndChecker() { + PastEndBugType.reset(new BugType(this, "Iter

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 80728. baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added a comment. Minor corrections, comments, some new tests, test input headers merged. https://reviews.llvm.org/D25660 Files: include/clang/StaticAnalyzer/Checkers

[PATCH] D26837: [analyzer] Litter the SVal/SymExpr/MemRegion class hierarchy with asserts.

2016-12-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:282 + static inline bool isCompoundType(QualType T) { +return T->isArrayType() || T->isRecordType() || Could you please move this function into a

<    5   6   7   8   9   10