[PATCH] D31886: [analyzer] Simplify values in binary operations more aggressively

2017-04-12 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. One last question: maybe we want to skip this kind of simplification in case of Z3? Probably the constraint managers could have a flag like "wantsSimplifiedConstraints"? Maybe somehow the checkers that are doing their own simplification could respect this flag as well

[PATCH] D31982: [analyzer] Improve suppression for inlined defensive checks when operator& is involved.

2017-04-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:975 + if (Op->getOpcode() == UO_AddrOf) +if (Op->getSubExpr()->isLValue()) { + Ex = Op->getSubExpr()->IgnoreParenCasts(); Maybe you could move this

[PATCH] D28765: CStringChecker can crash when uninitialized checks are disabled

2017-01-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. It is not supported to run the analyzer with some of the core checkers turned off. Maybe we should change the behavior such that turning off core checkers turn off the warnings from those checkers but not the checkers themselves? https://reviews.llvm.org/D28765 __

[PATCH] D28765: CStringChecker can crash when uninitialized checks are disabled

2017-01-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. You might want to give CodeChecker [1] a try as a workaround. It stores the results in a more compact format and you can do filtering. [1] https://github.com/Ericsson/codechecker https://reviews.llvm.org/D28765 ___ cfe-c

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

2017-01-26 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. 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. https://reviews.llvm.org/D29183 ___ cfe-

[PATCH] D29384: [analyzer] Fix an assertion fail in CStringSyntaxChecker

2017-02-01 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. Right now CStringSytanxChecker assumes that the argument of a sizeof expression is an expression. The argument can also be a type. In this case an assertion fail will be triggered when the SubExpression is being queried. I fixed this issue and did other minor cl

[PATCH] D23421: [Clang-tidy] CERT-MSC53-CPP (checker for std namespace modification)

2017-02-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Benedek, do you have time to address the review comments or do you want me to commandeer this revision? Repository: rL LLVM https://reviews.llvm.org/D23421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:/

[PATCH] D23423: [Clang-tidy] Comparison Function Address

2017-02-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Hi Benedek, could you do the merge or should anybody commandeer these revisions? Repository: rL LLVM https://reviews.llvm.org/D23423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-02-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I think this might be better as a readability checker to find misleading variable or parameter names. It would also be great to consider types. Unfortunately it probably means reimplementing some of the logic from Sema, since that information is not available at this

[PATCH] D34449: [clang-tidy] Enable constexpr definitions in headers.

2017-06-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 104111. xazax.hun marked 5 inline comments as done. xazax.hun added a comment. Herald added a subscriber: JDevlieghere. - Updates according to the reviews. https://reviews.llvm.org/D34449 Files: clang-tidy/misc/DefinitionsInHeadersCheck.cpp test/clang

[PATCH] D34506: Relax an assert in the comparison of source locations

2017-06-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D34506#791089, @akyrtzi wrote: > Comparing SourceLocations from different translation units is not meaningful > and my concern is that treating source locations like this can very easily > lead to errors where by mistake the code is resolvi

[PATCH] D34506: Factor out a functionality from `isBeforeInTranslationUnit`

2017-06-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 104167. xazax.hun retitled this revision from "Relax an assert in the comparison of source locations" to "Factor out a functionality from `isBeforeInTranslationUnit`". xazax.hun edited the summary of this revision. xazax.hun added a comment. - New approach

[PATCH] D34506: Factor out a functionality from `isBeforeInTranslationUnit`

2017-06-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I created a new public API that is using a piece of code that was factored out from `isBeforeInTranslationUnit`. Using this new function it is possible to implement proper comparison of source locations within the Static Analyzer. What do you think? https://reviews.

[PATCH] D34506: Factor out a functionality from `isBeforeInTranslationUnit`

2017-06-28 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 104358. xazax.hun added a comment. - Removed the whitespace changes - Factored out one more condition https://reviews.llvm.org/D34506 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp Index: lib/Basic/SourceManager.cpp ==

[PATCH] D34506: Factor out a functionality from `isBeforeInTranslationUnit`

2017-06-28 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D34506#792313, @akyrtzi wrote: > I'd prefer to avoid including whitespace-only changes (there are a couple of > lines in the diff with only whitespace change), otherwise LGTM! Great, thank you! If no one has objections I will commit this t

[PATCH] D34449: [clang-tidy] Enable inline variable definitions in headers.

2017-06-28 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 104360. xazax.hun marked 2 inline comments as done. xazax.hun retitled this revision from "[clang-tidy] Enable constexpr definitions in headers. " to "[clang-tidy] Enable inline variable definitions in headers. ". xazax.hun edited the summary of this revisi

[PATCH] D34449: [clang-tidy] Enable inline variable definitions in headers.

2017-06-28 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 104379. xazax.hun added a comment. - Unbreak the constexpr test. https://reviews.llvm.org/D34449 Files: clang-tidy/misc/DefinitionsInHeadersCheck.cpp docs/clang-tidy/checks/misc-definitions-in-headers.rst test/clang-tidy/misc-definitions-in-headers-

[PATCH] D34449: [clang-tidy] Enable inline variable definitions in headers.

2017-06-28 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: test/clang-tidy/misc-definitions-in-headers.hpp:1 -// RUN: %check_clang_tidy %s misc-definitions-in-headers %t +// RUN: %check_clang_tidy %s misc-definitions-in-headers %t -- -- -std=c++1z hokein wrote: > hokein wrot

[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

2017-06-29 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp:31 +class VirtualCallChecker: public Checker { + mutable std::unique_ptr BT_CT; + mutable std::unique_ptr BT_DT; Could you find more descriptive names for these BugT

[PATCH] D34512: [libTooling] Add preliminary Cross Translation Unit support for libTooling

2017-06-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 104848. xazax.hun added a comment. - Updated to compile with trunk - Minor style fixes - Proper diagnostic when the index format is wrong https://reviews.llvm.org/D34512 Files: include/clang/Basic/DiagnosticFrontendKinds.td include/clang/Tooling/Cross

[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

2017-07-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 105053. xazax.hun added a comment. - Patch scan-build instead of using custom scripts - Rebase patch based on the proposed LibTooling CTU code https://reviews.llvm.org/D30691 Files: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h include/clang/Sta

[PATCH] D34512: [libTooling] Add preliminary Cross Translation Unit support for libTooling

2017-07-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. It looks like Richard approved libTooling as a dependency for clang on the mailing list (http://lists.llvm.org/pipermail/cfe-dev/2017-July/054536.html). If it is ok to have this code in libTooling (for now), I think we could start/continue the review of this patch. h

[PATCH] D34512: [libTooling] Add preliminary Cross Translation Unit support for libTooling

2017-07-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D34512#800499, @klimek wrote: > In https://reviews.llvm.org/D34512#800490, @xazax.hun wrote: > > > It looks like Richard approved libTooling as a dependency for clang on the > > mailing list > > (http://lists.llvm.org/pipermail/cfe-dev/2017

[PATCH] D34512: Add preliminary Cross Translation Unit support library

2017-07-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 105409. xazax.hun retitled this revision from "[libTooling] Add preliminary Cross Translation Unit support for libTooling" to "Add preliminary Cross Translation Unit support library". xazax.hun added a comment. - Move CrossTU functionality into its own lib

[PATCH] D34512: Add preliminary Cross Translation Unit support library

2017-07-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D34512#800618, @klimek wrote: > +Richard as top-level code owner for new libs. > > For bikeshedding the name: I'd have liked libIndex, but that's already taken. > CrossTU doesn't seem too bad to me, too, though. Some brainstorming for the

[PATCH] D34512: Add preliminary Cross Translation Unit support library

2017-07-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 105412. xazax.hun marked an inline comment as done. xazax.hun added a comment. - Fix a copy and paste error and removed an unintended change. https://reviews.llvm.org/D34512 Files: include/clang/Basic/DiagnosticFrontendKinds.td include/clang/CrossTU/C

[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

2017-07-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. You are making a pretty good progress! I think right now there is some code duplication that could be reduced, but otherwise, the checker starts to look really good. Comment at: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp:43 +private: + bool

[PATCH] D34512: Add preliminary Cross Translation Unit support library

2017-07-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. gentle ping https://reviews.llvm.org/D34512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Are you sure this works as intended when e.g.: `$a+2==$b*3` So on one of the sides, the ops are not additive? I would like to see some test cases for that. Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:572 + lInt = &lSymIntExp

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

2017-07-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:500 + // If the type of A - B is the same as the type of A, then use the type of + // B as the type of B - A. Otherwise keep the type of A - B. + SymbolRef negSym = Sym

[PATCH] D35216: [analyzer] Escape symbols when creating std::initializer_list.

2017-07-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. At this point, I am a bit wondering about two questions. - When should something belong to a checker and when should something belong to the engine? Sometimes we model library aspects in the engine and model language constructs in checkers. - What is the checker progr

[PATCH] D34512: Add preliminary Cross Translation Unit support library

2017-07-12 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D34512#803724, @klimek wrote: > Specifically, ping Richard for new top-level lib in clang. Richard proposed pulling this out into a separate library in the first place. Do we need his approval for the name? Or we want him to consider if th

[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

2017-07-12 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thank you! I think we can start to run this check on real world code bases and evaluate the results. Comment at: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp:41 + void checkPreCall(const CallEvent &Call, CheckerContext &C) const; + void Chang

[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

2017-07-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp:72 +REGISTER_MAP_WITH_PROGRAMSTATE(CtorMap, const MemRegion *, bool) +REGISTER_MAP_WITH_PROGRAMSTATE(DtorMap, const MemRegion *, bool) + I was wondering if there is an

[PATCH] D35674: [analyzer] Treat C++ throw as sink during CFG-based suppress-on-sink.

2017-07-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. One minor nit, otherwise looks good to me. Comment at: lib/StaticAnalyzer/Core/BugReporter.cpp: +})) { + // Throw-expressions are currently generating sinks during symbolic + // execution: they'r

[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

2017-07-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added reviewers: dcoughlin, NoQ, a.sidorin. xazax.hun added a comment. This revision is now accepted and ready to land. Looks good to me. Did you run it on a codebase to check the results? https://reviews.llvm.org/D33672

[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

2017-07-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a reviewer: aaron.ballman. xazax.hun added a comment. Aaron, could you comment on the applicability of this check to C? Thanks in advance. https://reviews.llvm.org/D33672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-07-28 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: test/clang-tidy/readability-static-accessed-through-instance.cpp:34 + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member accessed through instance [readability-static-accessed-through-instance] + // CHECK-FIXES: {{^}} C::x;

[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

2018-01-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/PathDiagnostic.cpp:418-423 SourceLocation XDL = XD->getLocation(); SourceLocation YDL = YD->getLocation(); if (XDL != YDL) { const SourceManager &SM = XL.getManager(); - return SM.isBe

[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

2018-01-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/PathDiagnostic.cpp:418-423 SourceLocation XDL = XD->getLocation(); SourceLocation YDL = YD->getLocation(); if (XDL != YDL) { const SourceManager &SM = XL.getManager(); - return SM.isBe

[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

2018-01-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 129509. xazax.hun marked 5 inline comments as done. xazax.hun added a comment. - Fixed review comments https://reviews.llvm.org/D30691 Files: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngin

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2018-01-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. This should be rebased to latest master. https://reviews.llvm.org/D38845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42335: [ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTemplateSpecializationType, DependentSizedArray importing.

2018-01-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: a.sidorin, szepet. Herald added subscribers: dkrupp, rnkovacs. Also fix a problem with CXXTemporaryObjectExpr. Repository: rC Clang https://reviews.llvm.org/D42335 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp

[PATCH] D42335: [ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTemplateSpecializationType, DependentSizedArray importing.

2018-01-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 130961. xazax.hun marked 2 inline comments as done. xazax.hun added a comment. - Address review comments. https://reviews.llvm.org/D42335 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp ==

[PATCH] D42335: [ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTemplateSpecializationType, DependentSizedArray importing.

2018-01-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D42335#983878, @a.sidorin wrote: > Hello Peter, > > Thank you for the patch! It is almost LGTM, just a few minor questions inline. > Am I understand correctly that it is partially based on > https://github.com/haoNoQ/clang/blob/summary-ipa-

[PATCH] D42301: [ASTImporter] Support LambdaExprs and improve template support

2018-01-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. High level note: `clang::TypeAliasDecl` has the same issue as `CXXRecordDecl`, so templated versions should not be added to the DeclContext. Could you add that just for the sake of completeness? Repository: rC Clang https://reviews.llvm.org/D42301 _

[PATCH] D42301: [ASTImporter] Support LambdaExprs and improve template support

2018-01-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I do not see a test for the following changes: - ASTImporter: don't add templated declarations into DeclContext - ASTImporter: proper set ParmVarDecls for imported FunctionProtoTypeLoc Comment at: lib/AST/ASTImporter.cpp:2085 + case FunctionDecl::TK

[PATCH] D42301: [ASTImporter] Support LambdaExprs and improve template support

2018-01-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D42301#984713, @a.sidorin wrote: > > I do not see a test for the following changes: > > > > - ASTImporter: don't add templated declarations into DeclContext > > It's in ASTImporterTest. It checks that the templated decl cannot be found in >

[PATCH] D42335: [ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTemplateSpecializationType, DependentSizedArray importing.

2018-01-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 131059. xazax.hun added a comment. - Added import for CXXTypeidExpr. What is the best way to test this? header is required for using the typeid operator, but relying on the presence of an STL library in tests is usually considered as a bad practice. Sho

[PATCH] D42335: [ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTemplateSpecializationType, DependentSizedArray, CXXTypeidExpr importing.

2018-01-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 131065. xazax.hun retitled this revision from "[ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTemplateSpecializationType, DependentSizedArray importing." to "[ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTem

[PATCH] D42301: [ASTImporter] Support LambdaExprs and improve template support

2018-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D42301#986583, @a.sidorin wrote: > I'd rather create a separate patch - this one is already large enough. Is it > OK? Yeah, that is fine by me. Repository: rC Clang https://reviews.llvm.org/D42301 __

[PATCH] D42301: [ASTImporter] Support LambdaExprs and improve template support

2018-01-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. Overall looks good! Thanks for working on this! Comment at: lib/AST/ExternalASTMerger.cpp:403 +ASTImporter *Importer = C.second; +NamedDecl *ND = cast(Importer-

[PATCH] D42335: [ASTImporter] Supporting CXXOperatorCallExpr, SizeOfPackExpr, DependentTemplateSpecializationType, DependentSizedArray, CXXTypeidExpr importing.

2018-01-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 131406. xazax.hun marked 2 inline comments as done. xazax.hun added a comment. - Address review comments. https://reviews.llvm.org/D42335 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp ==

[PATCH] D42682: [clang-tidy] Add misc-io-functions-misused checker

2018-01-30 Thread Gábor Horváth via Phabricator via cfe-commits
hgabii created this revision. hgabii added a reviewer: clang-tools-extra. hgabii added a project: clang-tools-extra. Herald added subscribers: cfe-commits, hintonda, mgorny, srhines. Add misc-io-functions-misused checker to warns for cases when the return value of certain standard iostream C func

[PATCH] D42672: [CFG] [analyzer] Heavier CFGConstructor elements.

2018-02-04 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: include/clang/Analysis/CFG.h:153 + + ConstructionContext() = default; + ConstructionContext(CXXConstructExpr *Constructor, Stmt *Trigger) Maybe I am getting this wrong, but I think in this case the members will be d

[PATCH] D15227: [analyzer] Valist checkers.

2017-02-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D15227#674278, @zaks.anna wrote: > @xazax.hun, > > Can we move this out of alpha? > > Have this checkers been tested on a large codebase? What are false positive > rates? I have tested it on a few ~200k LOC C codebase and I did not see any

[PATCH] D29839: [clang-tidy] New misc-istream-overflow check

2017-02-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Shouldn't this be a path sensitive check within the clang static analyzer instead? So branches are properly handled and interprocedural analysis is done. https://reviews.llvm.org/D29839 ___ cfe-commits mailing list cfe-co

[PATCH] D29839: [clang-tidy] New misc-istream-overflow check

2017-02-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D29839#674307, @Prazek wrote: > In https://reviews.llvm.org/D29839#674301, @xazax.hun wrote: > > > Shouldn't this be a path sensitive check within the clang static analyzer > > instead? So branches are properly handled and interprocedural an

[PATCH] D29884: [analyzer] Proper caching in CallDescription objects.

2017-02-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. During the review of https://reviews.llvm.org/D29567 it turned out the caching in CallDescription is not implemented properly. In case an identifier does not exist in a translation unit, repeated identifier lookups will be done which might have bad impact on the

[PATCH] D23427: [Clang-tidy] Comparison Misuse

2017-02-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun abandoned this revision. xazax.hun added a comment. For the first case ToT clang compiler gives a warning (-Wstring-compare), for the second case, it generates a compiler error (error: ordered comparison between pointer and zero). Note that, older versions of clang did not even give a

[PATCH] D23423: [Clang-tidy] Comparison Function Address

2017-02-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun abandoned this revision. xazax.hun added a comment. -Wtautological-pointer-compare already covers this case. Repository: rL LLVM https://reviews.llvm.org/D23423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D19586: Misleading Indentation check

2017-02-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun commandeered this revision. xazax.hun edited reviewers, added: Pajesz; removed: xazax.hun. xazax.hun added a comment. Herald added a subscriber: mgorny. The original author is no longer available. https://reviews.llvm.org/D19586 ___ cfe-co

[PATCH] D19586: Misleading Indentation check

2017-02-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 88182. xazax.hun added a comment. - Updated to latest trunk. - Mentioned check in the release notes. - Documented the limitation that tabs and spaces need to be consistent for this check to work. - Fixed (hopefully all) review comments. - Fixed the test cas

[PATCH] D19586: Misleading Indentation check

2017-02-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 13 inline comments as done. xazax.hun added inline comments. Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:20 + +void MisleadingIndentationCheck::danglingElseCheck( +const MatchFinder::MatchResult &Result) { danielmarjamak

[PATCH] D19586: Misleading Indentation check

2017-02-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 88330. xazax.hun marked 7 inline comments as done. xazax.hun added a comment. - Added a note to make it easier to understand the diagnostics. - Reworded the error message about dangling else. - Fixed other review comments. https://reviews.llvm.org/D19586

[PATCH] D19586: Misleading Indentation check

2017-02-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thank you for the review! Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:79 + Finder->addMatcher( + compoundStmt(anyOf(has(ifStmt()), has(forStmt()), has(whileStmt( + .bind("compound"), alexfh wro

[PATCH] D23421: [Clang-tidy] CERT-MSC53-CPP (checker for std namespace modification)

2017-02-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 88333. xazax.hun marked 9 inline comments as done. xazax.hun added a comment. - Updated to latest trunk. - The cert rule was renamed, the patch is updated accordingly. - Fixes as per review comments. https://reviews.llvm.org/D23421 Files: clang-tidy/cer

[PATCH] D19586: Misleading Indentation check

2017-02-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:79 + Finder->addMatcher( + compoundStmt(anyOf(has(ifStmt()), has(forStmt()), has(whileStmt( + .bind("compound"), alexfh wrote: > xazax.hun wrote:

[PATCH] D23421: [Clang-tidy] CERT-DCL58-CPP (checker for std namespace modification)

2017-02-15 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 88506. xazax.hun marked 3 inline comments as done. xazax.hun retitled this revision from "[Clang-tidy] CERT-MSC53-CPP (checker for std namespace modification)" to "[Clang-tidy] CERT-DCL58-CPP (checker for std namespace modification)". xazax.hun edited the s

[PATCH] D23421: [Clang-tidy] CERT-DCL58-CPP (checker for std namespace modification)

2017-02-15 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 88541. xazax.hun added a comment. - Do not warn for function specializations within the std namespace. - Add a test case for swap. https://reviews.llvm.org/D23421 Files: clang-tidy/cert/CERTTidyModule.cpp clang-tidy/cert/CMakeLists.txt clang-tidy/ce

[PATCH] D29884: [analyzer] Proper caching in CallDescription objects.

2017-02-15 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D29884#677387, @NoQ wrote: > Yep, seems that somebody has missed these issues :) > > I guess there's no way to test the operator case, because nobody made a > CallDescription with an empty name for us (maybe we should even assert that). Th

[PATCH] D29884: [analyzer] Proper caching in CallDescription objects.

2017-02-15 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:73 + : II(nullptr), IsLookupDone(false), FuncName(FuncName), +RequiredArgs(RequiredArgs) {} NoQ wrote: > Maybe `assert(FuncName.size

[PATCH] D6550: ASTImporter: Fix missing SourceLoc imports

2017-02-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D6550#663002, @a.sidorin wrote: > Hi Gabor. One of the bugs fixed in this patch is still present in master, > other two are already fixed. Thanks for checking that! Do you think it is ok for me to commit the missing part? https://review

[PATCH] D6549: ASTImporter: Propagate implicit flag to imported record and field decls

2017-02-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D6549#662955, @a.sidorin wrote: > This should be fixed in r269693. Indeed, I commandeer than abandon this revision so it is closed. https://reviews.llvm.org/D6549 ___ cfe-commits mailing list

[PATCH] D30157: [analyzer] Improve valist check

2017-02-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. This patch makes the valist check more robust to the different kind of ASTs that are generated on different platforms: Generated on x86_64-pc-linux-gnu: |-TypedefDecl 0x1d07a40 <> implicit __builtin_ms_va_list 'char *' | `-PointerType 0x1d07a00 'char *'

[PATCH] D15227: [analyzer] Valist checkers.

2017-02-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D15227#681127, @zaks.anna wrote: > > But as far as I remember, this produced false negatives in the tests not > > false positives. > > Could you double check that? Maybe you still have some notes in your mail box > or just by looking at t

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Nice check! Thank you for working on this! Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:30 +" The old user defined 'RandomFunction' is not usable for 'shuffle'. You " +"need to " +"make additional changes if you want a sp

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:30 +" The old user defined 'RandomFunction' is not usable for 'shuffle'. You " +"need to " +"make additional changes if you want a specific random function."; -

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:81 + Stream << "shuffle("; + FirstArgument->printPretty(Stream, nullptr, Ctx.getPrintingPolicy()); + Stream << ", "; madsravn wrote: > xazax.hun wrote: > > madsravn

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89185. xazax.hun added a comment. - Address some review comments. - Add some additional tests. - Fixed some false positives (checking for symbolic values for va_copy and more robust detection of which valist model is used by the platform) - I have run the c

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 3 inline comments as done. xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ValistChecker.cpp:178 +VaListModelledAsArray = Cast->getCastKind() == CK_ArrayToPointerDecay; + const MemRegion *Reg = SV.getAsRegion(); + if (const auto *De

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89187. xazax.hun marked 3 inline comments as done. xazax.hun added a comment. - Fixed a comment. https://reviews.llvm.org/D30157 Files: lib/StaticAnalyzer/Checkers/ValistChecker.cpp test/Analysis/valist-uninitialized-no-undef.c test/Analysis/valist-

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: test/Analysis/valist-uninitialized-no-undef.c:19 + // FIXME: There should be no warning for this. + (void)va_arg(*fst, int); // expected-warning{{va_arg() is called on an uninitialized va_list}} expected-note{{va_arg() is called on

[PATCH] D30157: [analyzer] Improve valist check

2017-02-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89780. xazax.hun added a comment. - Minor style improvement. https://reviews.llvm.org/D30157 Files: lib/StaticAnalyzer/Checkers/ValistChecker.cpp test/Analysis/valist-uninitialized-no-undef.c test/Analysis/valist-uninitialized.c test/Analysis/vali

[PATCH] D30157: [analyzer] Improve valist check

2017-02-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89857. xazax.hun edited the summary of this revision. xazax.hun added a comment. - Move the check out of alpha. https://reviews.llvm.org/D30157 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/ValistChecker.cpp te

[PATCH] D30489: [analyzer] catch out of bounds for VLA

2017-03-01 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. There is an alternative approach idea: This is not found by ArrayBoundCheckerV2? If no, an alternative approach would be to properly set the constraints on the extent of the VLA's memory region. After that, maybe ArrayBoundCheckerV2 would work automatically on this ca

[PATCH] D15090: [Static Analyzer] New checker hook: checkInitialState

2017-03-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In the meantime CheckBeginFunction has been implemented separately. I think you should "abandon" this revision so it is shown as closed. https://reviews.llvm.org/D15090 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D30157: [analyzer] Improve valist check

2017-03-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 90676. xazax.hun marked an inline comment as done. xazax.hun added a comment. - Improve the readability of test files. - Rebased on latest ToT. https://reviews.llvm.org/D30157 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer

[PATCH] D30157: [analyzer] Improve valist check

2017-03-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D30157#689374, @danielmarjamaki wrote: > I am running this checker right now on various projects. Here are currently > seen results.. https://drive.google.com/open?id=0BykPmWrCOxt2STZMOXZ5OGlwM3c > > Feel free to look at it and see if there

[PATCH] D30639: [clang-tidy] Ignore substituted template types in modernize-use-nullptr check.

2017-03-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: test/clang-tidy/modernize-use-nullptr.cpp:252 + public: + explicit TemplateClass(int a, T default_value = 0) {} +}; It might be great to have a test case for: ``` template class TemplateClass { public: explicit T

[PATCH] D30639: [clang-tidy] Ignore substituted template types in modernize-use-nullptr check.

2017-03-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: test/clang-tidy/modernize-use-nullptr.cpp:254 + + void h(T *default_value = 0) {} + Great! Thanks for adding this test. I have the impression we do want to warn and fix this case however. What do you think? https:/

[PATCH] D30639: [clang-tidy] Ignore substituted template types in modernize-use-nullptr check.

2017-03-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr.cpp:254 + + void h(T *default_value = 0) {} + Maybe as a separate patch, but I think it might be worth to warn here. WDYT? (Sorry for the double post, th

[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

2017-03-07 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. Herald added a subscriber: mgorny. This patch adds support for naive cross translational unit analysis. The aim of this patch is to be minimal to enable the development of the feature on the top of tree. This patch should be an NFC in case XTUDir is not provided

[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

2017-03-07 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Guide to run the two pass analysis: Process --- These are the steps of XTU analysis: 1. `xtu-build.py` script uses your compilation database and extracts all necessary information from files compiled. It puts all its generated data into a folder (.xtu by default

[PATCH] D30798: [analyzer] Turn suppress-c++-stdlib on by default

2017-03-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D30798#697115, @zaks.anna wrote: > I've committed the change, but would very much appreciate community feedback > here if if there is any! I agree with the change. Users are usually not interested in the results from the standard library,

[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

2017-03-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Functionally LGTM! Note that while the traversal of AST Matchers are not defined in general, in this particular case of chained ifs, it is guaranteed that parent nodes will be matched before the child nodes. For this reason I think it is ok to have a state like this.

[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

2017-03-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D30841#698634, @fgross wrote: > I just assumed it would traverse in the "right" way, is there any > documentation about AST / matcher traversal? I do not kn

[PATCH] D30547: [clang-tidy] Forwarding reference overload in constructors

2017-03-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/misc/MiscTidyModule.cpp:70 +CheckFactories.registerCheck( +"misc-forwarding-reference-overload"); CheckFactories.registerCheck("misc-misplaced-const"); malcolm.parsons wrote: > aaron.ballman

[PATCH] D30896: [Clang-tidy] add check misc-prefer-switch-for-enums

2017-03-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Also, maybe the readability module would be a better place for this check. Repository: rL LLVM https://reviews.llvm.org/D30896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailma

[PATCH] D27211: [clang-format] Implement comment reflowing

2016-12-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/Format/Encoding.h:136 + } + while (Left + 1 < Right) { +assert(ComputeWidth(Left) <= Width && "binary search left invariant"); Was just skimming through this patch. What is the reason to use a hand written a

<    8   9   10   11   12   13   14   15   >