[PATCH] D79433: [analyzer] StdLibraryFunctionsChecker: Add summaries for POSIX

2020-05-14 Thread Gabor Marton via Phabricator via cfe-commits
martong planned changes to this revision. martong added a comment. With @xazax.hun we agreed that we should try our best to provide signatures for all functions. This includes two major changes: 1. Add signatures to each summary here, possibly with `Irrelevant` types. 2. Add the ability to looku

[PATCH] D80016: [analyzer] StdLibraryFunctionsChecker: Add support to lookup types

2020-05-15 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: xazax.hun, NoQ, Szelethus, balazske. Herald added subscribers: cfe-commits, ASDenysPetrov, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity. Herald added a projec

[PATCH] D72705: [analyzer] Added new checker 'alpha.unix.ErrorReturn'.

2020-05-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D72705#2036066 , @balazske wrote: > It is a way of find some of the cases with the mentioned way of tracking what > operations are allowed after what operations with or without error check, on > a specific stream. Instead of a

[PATCH] D79704: [Analyzer] [NFC] Parameter Regions

2020-05-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Wow, this is some nice work and huge effort from all the participants, it was pretty informative to read through. Thanks @baloghadamsoftware and @NoQ for working on this! > This means that we always found a Decl. However, this Decl is not stored but > retrieved always

[PATCH] D40937: [clang-tidy] Infinite loop checker

2017-12-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang-tidy/misc/InfiniteLoopCheck.cpp:105 + return llvm::make_unique( + *(new ExprSequence(TheCFG.get(), &ASTCtx))); +} `make_unique` is a forwarding function, therefore there is no need to create an object and th

[PATCH] D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion

2022-08-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > So I think the most valuable optimizations are low-level optimizations to > `ImmutableMap`. There were a few suggestions on the mailing list to use > something more modern than the AVL trees under the hood but I don't think > authors found much success with those. Ba

[PATCH] D131879: [clang][analyzer] Errno modeling code refactor (NFC).

2022-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Herald added a subscriber: rnkovacs. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131879/new/ https://reviews.llvm.org/D131879 ___ cfe-comm

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. I am okay with this change, it does give a proper canonical form, which is good. On the other hand, I agree that (on the long term) base regions and offsets would be a better memory model th

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:799 + /// we actually know their types. + QualType getApproximatedType() const { +return sym->getType()->getPointeeType(); steakhal wrote: > marton

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:3748-3751 + // If it is a template, import all related things. + if (Error Err = ImportTemplateInformation(D, ToFunction)) +return std::move(Err); + What's the reason of moving this hu

[PATCH] D132109: [analyzer] Dump the environment entry kind as well

2022-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132109/new/ https://reviews.llvm.org/D132109 _

[PATCH] D133698: [clang][dataflow] SignAnalysis, edgeTransfer, branchTransfer

2022-09-12 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: xazax.hun, gribozavr2, sgatev, ymandel, samestep. Herald added subscribers: steakhal, gamesh411, Szelethus, dkrupp, rnkovacs, mgorny. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a project: All. martong reque

[PATCH] D133851: [analyzer] Initialize ShouldEmitErrorsOnInvalidConfigValue analyzer option

2022-09-14 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Okay, I don't see any problem with this change. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133851/new/ https://reviews.llvm.org/D1338

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2022-09-15 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 7 inline comments as done. martong added inline comments. Herald added a project: All. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:156-157 // the bug is reported. -virtual std::string describe(ProgramStateRef State, +v

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2022-09-15 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 460345. martong marked 2 inline comments as done. martong added a comment. - Rebase - move Msg into the lambda Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101526/new/ https://reviews.llvm.org/D101526 Files:

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2022-09-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Gentle ping @steakhal @NoQ Trying to revive this after a year :) I am sorry it took so long to get back to this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101526/new/ https://reviews.llvm.org/D101526

[PATCH] D133931: [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const CFGElement *, ...)` in `clang/Analysis/FlowSensitive`.

2022-09-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp:137-140 +auto CS = E->getAs(); +if (!CS) + return; +auto S = CS->getStmt(); This is exactly the same code that you have in `Si

[PATCH] D103096: [analyzer] Implement cast for ranges of symbolic integers

2022-06-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103096#3613059 , @ASDenysPetrov wrote: > @martong Just FYI. I've been working on reworking this solution to using > `EquivalenceClasses` for several weeks. It turned out that this is an > extremely hard task to acomplish. T

[PATCH] D128704: [clang-extdef-mapping] Directly process .ast files

2022-07-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks, this is a great addition! - Please use Capitalized names for all the variables (as per the LLVM coding standards suggests here ). - Could you please update the re

[PATCH] D128704: [clang-extdef-mapping] Directly process .ast files

2022-07-04 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Thanks for the update! LGTM (with very minor naming nits). Comment at: clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp:146 + +static bool HandleAST(StringRef astPath

[PATCH] D128608: [NFC][ASTImporter] remove the unnecessary condition checks in ASTImporter.cpp

2022-07-04 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM (I don't quite understand the rename and the [LLDB] tag, this is clearly in [Clang][ASTImporter]. Yes, LLDB depends on the ASTImporter). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D128535: [analyzer] Improve loads from reinterpret-cast fields

2022-07-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I like it, but I'd like to know more about the nature of the applied "hack" and if there is a way to solve it properly in the longer term. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2014-2017 + // FIXME: This is a hack, and doesn't do a

[PATCH] D127874: [analyzer] Reimplement UnreachableCodeChecker using worklists

2022-07-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > I don't think any of the issues mentioned in this patch relates to strongly > connected components, thus I don't think I can answer to this question. In your example above, repeated here: #6(entry) #2(goto a;) | |^ #5(goto end;) |

[PATCH] D127874: [analyzer] Reimplement UnreachableCodeChecker using worklists

2022-07-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D127874#3628112 , @martong wrote: >> I don't think any of the issues mentioned in this patch relates to strongly >> connected components, thus I don't think I can answer to this question. > > In your example above, repeated he

[PATCH] D128068: [analyzer] Do not emit redundant SymbolCasts

2022-07-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D128068#3594171 , @steakhal wrote: >> We can't just do that check in `evalCast` because there are many additonal >> logic before we'd end up in `makeNonLoc`. > > I'm not exactly up to date. Could you please extend the summary

[PATCH] D128068: [analyzer] Do not emit redundant SymbolCasts

2022-07-05 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5d7fa481cf4d: [analyzer] Do not emit redundant SymbolCasts (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D126779: [analyzer] Fix assertion in simplifySymbolCast

2022-07-05 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. martong marked 2 inline comments as done. Closed by commit rG2df120784af4: [analyzer] Fix assertion in simplifySymbolCast (authored by martong). Repository: rG LLVM

[PATCH] D129280: [analyzer] PlacementNewChecker, properly handle array overhead (cookie)

2022-07-07 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: isuckatcs, NoQ, bruntib, steakhal. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Her

[PATCH] D129280: [analyzer] PlacementNewChecker, properly handle array overhead (cookie)

2022-07-08 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 443174. martong added a comment. - Replace "might" with "unspecified value" Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129280/new/ https://reviews.llvm.org/D129280 Files: clang/lib/StaticAnalyzer/Checkers

[PATCH] D129280: [analyzer] PlacementNewChecker, properly handle array overhead (cookie)

2022-07-08 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:157 "Storage provided to placement new is only {0} bytes, " -"whereas the allocated array type requires more space

[PATCH] D122243: [analyzer][NFC] Introduce the checker package separator character

2022-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122243/new/ https://reviews.llvm.org/D122243 __

[PATCH] D122244: [analyzer] Turn missing tablegen doc entry of a checker into fatal error

2022-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Good. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122244/new/ https://reviews.llvm.org/D122244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[PATCH] D121459: [analyzer] Remove HasAlphaDocumentation tablegen enum value

2022-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Hahh, indeed. IMHO, it does not make sense to write an "alpha" documentation, either write it properly or do not write anything. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103094#3403075 , @ASDenysPetrov wrote: > Ping. I am still interested in this! I am sorry for being inactive with it lately, I hope I'll have time soon to continue the review of this patch stack. CHANGES SINCE LAST ACTION

[PATCH] D122525: [clang][ASTImporter] Fix an import error handling related bug.

2022-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Nice catch! Comment at: clang/lib/AST/ASTImporter.cpp:8789-8791 +// The import path contains child nodes first. +// (Parent-child relationship is used here in sense of import +// dependency.) I think, this commen

[PATCH] D122528: [clang][ASTImporter] Not using consumeError at failed import of in-class initializer.

2022-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Thanks! Good catch! (For inexperienced readers, let me explain why I accepted the patch: If there is an error then the imported Decl is marked as erroneous, i.e an Error object is associate

[PATCH] D122525: [clang][ASTImporter] Fix an import error handling related bug.

2022-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Related: https://reviews.llvm.org/D112132 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122525/new/ https://reviews.llvm.org/D122525 ___ cfe-commits mailing list cfe-commits@list

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, gamesh411. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All.

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added a comment. In D122805#3419129 , @steakhal wrote: > Please add a test case where the class is trivial but the global variable of > such is non-const, thus the initialized expression is not imported.

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 419475. martong marked 3 inline comments as done. martong added a comment. - Remove blank line - Fix comment - Add new check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122805/new/ https://reviews.llvm.org/D1

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D122805#3420111 , @steakhal wrote: > In D122805#3419662 , @martong wrote: > >> In D122805#3419129 , @steakhal >> wrote: >> >>> Please add a te

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D122805#3421676 , @martong wrote: > In D122805#3420111 , @steakhal > wrote: > >> In D122805#3419662 , @martong >> wrote: >> >>> In D122805#34

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 419683. martong added a comment. - Add extNonConstS to the externalDefMap.txt Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122805/new/ https://reviews.llvm.org/D122805 Files: clang/include/clang/CrossTU/Cro

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D122805#3421802 , @steakhal wrote: > In D122805#3421746 , @martong wrote: > >> In D122805#3421676 , @martong >> wrote: >> >>> In D122805#34201

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > even if something changes in the extdefmap tool We already have a separate test file for that. That is `func-mapping-test.cpp`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122805/new/ https://reviews.llvm.org/D122805

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 419702. martong added a comment. - Rebase to llvm/main Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122805/new/ https://reviews.llvm.org/D122805 Files: clang/include/clang/CrossTU/CrossTranslationUnit.h c

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 419717. martong added a comment. - remove extNonConstS from the externalDefMap.txt Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122805/new/ https://reviews.llvm.org/D122805 Files: clang/include/clang/CrossT

[PATCH] D122805: [analyzer][ctu] Only import const and trivial VarDecls

2022-04-01 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe63b81d10e02: [analyzer][ctu] Only import const and trivial VarDecls (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D130470: [clang][analyzer] Add more wide-character functions to CStringChecker

2022-07-27 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Herald added a subscriber: rnkovacs. In D130470#3682131 , @balazske wrote: > A related question: > Is it better to have a more generic function like

[PATCH] D130372: [analyzer] Add a new factory function RangeSet::Factory::invert

2022-07-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > The motivation is to extend the set of operations that can be performed on > range sets. Specifically, this function is needed for the next patch in the > stack. Would be great to see the motivation clearly and early. What will be the next patch about? ===

[PATCH] D130372: [analyzer] Add a new factory function RangeSet::Factory::invert

2022-08-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D130372#3683275 , @ASDenysPetrov wrote: > Now I'm working on the next patch and you'll see a motivation soon. Thanks for the update! Looks good, but I am still waiting with my formal approve to understand the motivation.

[PATCH] D130705: [clang][ASTImporter] Improve import of functions with auto return type.

2022-08-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D130705#3685299 , @balazske wrote: > It is still not perfect, analysis of qtbase is not better than before and > some of the unreachable assertions were encountered. Does it mean you plan some updates on this patch? Reposit

[PATCH] D131006: [analyzer] Use DisequalityMap while inferring constraints

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Awesome! Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1512-1516 +if (IsFirst) { + IsFirst = false; + RS = *RSPtr; +} else + RS = RangeFactory.unite(RS, *RSPtr); `unite`

[PATCH] D130372: [analyzer] Add a new factory function RangeSet::Factory::invert

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM! Nice work! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130372/new/ https://reviews.llvm.org/D130372 ___ cfe-commits mailing list

[PATCH] D131006: [analyzer] Use DisequalityMap while inferring constraints

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/range-inferring-from-disequality-map.cpp:10-11 + clang_analyzer_value(x); // expected-warning {{32s:{ [0, 0] }}} + // TODO: TODO: Keep x range correct even if associated disequalities are + // already dead. +

[PATCH] D130470: [clang][analyzer] Add more wide-character functions to CStringChecker

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. I think there's only some very minor style nits which are remained, but that should not block this any further. Let's land it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130470/new/ https

[PATCH] D131067: [analyzer] Treat values passed as parameter as escaped

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks, looks good with some nits. Comment at: clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:556-558 +unsigned numParams = FD->getNumParams(); +for (unsigned i = 0; i < numParams; ++i) { + findReferenceParameter(FD->getParamDecl(i

[PATCH] D130705: [clang][ASTImporter] Improve import of functions with auto return type.

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thank you, nice and assiduous work! The changes look good to me, but I think we should have some more tests where variable and function template specializations are used as return types. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D131067: [analyzer] Treat values passed as parameter as escaped

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Herald added a subscriber: rnkovacs. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131067/new/ https://reviews.llvm.org/D131067

[PATCH] D131006: [analyzer] Use DisequalityMap while inferring constraints

2022-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/range-inferring-from-disequality-map.cpp:50-51 +if(x != tmp1 && x != tmp2) + // TODO: This condition should be infeasible. + // Thus, the branch should be unreachable. + clang_analyzer_value(x

[PATCH] D130705: [clang][ASTImporter] Improve import of functions with auto return type.

2022-08-08 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Thank you for the update! LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130705/new/ https://reviews.llvm.org/D130705 __

[PATCH] D106063: [Analyzer][solver] Remove unused functions

2021-07-15 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added a reviewer: vsavchenko. Herald added subscribers: manas, steakhal, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. mar

[PATCH] D105692: [analyzer][solver][NFC] Introduce ConstraintAssignor

2021-07-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D105692#2879186 , @uabelho wrote: > Hi, > > When compiling with gcc I see the following new warnings with this patch: > > [4/22] Building CXX object > tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCor

[PATCH] D106063: [Analyzer][solver] Remove unused functions

2021-07-15 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd0d37fcc4e29: [Analyzer][solver] Remove unused functions (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D106136: [Analyzer][solver] Fix equivalence class invariant violation in removeDeadBindings

2021-07-16 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: vsavchenko, NoQ, steakhal. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus.

[PATCH] D106136: [Analyzer][solver] Fix equivalence class invariant violation in removeDeadBindings

2021-07-16 Thread Gabor Marton via Phabricator via cfe-commits
martong added a subscriber: vabridgers. martong added a comment. Note1: This issue is not related to and does not fix https://bugs.llvm.org/show_bug.cgi?id=51109 Note2: I am about to measure any performance penalty induced by the extra bookkeeping we must do. Repository: rG LLVM Github Monor

[PATCH] D106136: [Analyzer][solver] Fix equivalence class invariant violation in removeDeadBindings

2021-07-16 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for taking your time to take a look. And I accept your statements. Nevertheless, let me explain my motivation. I thought that a class is trivial if it has only one member. And it seemed perfectly logical to not store equivalence classes with one member. I.e `a`

[PATCH] D106285: [Analyzer][solver] Fix inconsistent equivalence class data

2021-07-19 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added a reviewer: vsavchenko. Herald added subscribers: manas, steakhal, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. mar

[PATCH] D106285: [Analyzer][solver] Fix inconsistent equivalence class data

2021-07-19 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 359813. martong added a comment. - Remove unnecessary comment (the API tells it all) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106285/new/ https://reviews.llvm.org/D106285 Files: clang/lib/StaticAnalyzer

[PATCH] D106136: [Analyzer][solver] Fix equivalence class invariant violation in removeDeadBindings

2021-07-20 Thread Gabor Marton via Phabricator via cfe-commits
martong abandoned this revision. martong added a comment. In D106136#2883707 , @vsavchenko wrote: > In D106136#2883100 , @martong wrote: > >> Thanks for taking your time to take a look. And I accept your statemen

[PATCH] D106370: [Analyzer][solver][NFC] Add explanatory comments to trivial eq classes

2021-07-20 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: vsavchenko, NoQ, steakhal. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus.

[PATCH] D106136: [Analyzer][solver] Fix equivalence class invariant violation in removeDeadBindings

2021-07-20 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Here it is: https://reviews.llvm.org/D106370 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106136/new/ https://reviews.llvm.org/D106136 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D106370: [Analyzer][solver][NFC] Add explanatory comments to trivial eq classes

2021-07-21 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG732a8a9dfb3e: [Analyzer][solver][NFC] Add explanatory comments to trivial eq classes (authored by martong). Changed prior to commit: https://revie

[PATCH] D106370: [Analyzer][solver][NFC] Add explanatory comments to trivial eq classes

2021-07-21 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D106370#2892390 , @NoQ wrote: > I understood this comment! Thanks for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106370/new/ https://reviews.llvm.org/D106370 __

[PATCH] D105354: [clang][AST] Add support for DecompositionDecl to ASTImporter.

2021-07-22 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/AST/ASTImporter.cpp:2305-2309 + BindingDecl *ToD; + if (GetImportedOrCreateDecl(ToD, D, Importer.getToContext(), DC, Loc, +

[PATCH] D106285: [Analyzer][solver] Fix inconsistent equivalence class data

2021-07-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106285/new/ https://reviews.llvm.org/D106285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D106642: [Analyzer][solver][NFC] print constraints deterministically (ordered by their string representation)

2021-07-23 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: NoQ, vsavchenko, steakhal, Szelethus. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, mgrang, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. martong requested review of

[PATCH] D106285: [Analyzer][solver] Fix inconsistent equivalence class data

2021-07-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D106285#2899545 , @vsavchenko wrote: > Oh, I didn't accept it? Sorry! No problem, thanks for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106285/new/ https://rev

[PATCH] D106285: [Analyzer][solver] Fix inconsistent equivalence class data

2021-07-23 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG44fa31fa6da0: [Analyzer][solver] Fix inconsistent equivalence class data (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D106644: [clang][analyzer] Add standard streams to alpha.unix.Stream checker.

2021-07-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:215-236 +const VarDecl *findStdStreamDecl(StringRef StdName, CheckerContext &C) { + ASTContext &ACtx = C.getASTContext(); + + IdentifierInfo &II = ACtx.Idents.get(StdName); + auto Lo

[PATCH] D106642: [Analyzer][solver][NFC] print constraints deterministically (ordered by their string representation)

2021-07-26 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4761321d49db: [Analyzer][solver][NFC] print constraints deterministically (ordered by their… (authored by martong). Changed prior to commit: https

[PATCH] D106642: [Analyzer][solver][NFC] print constraints deterministically (ordered by their string representation)

2021-07-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D106642#2900397 , @NoQ wrote: > Thanks! > > You got me thinking whether two symbols can have the same dump. We definitely > don't want this to happen but there's also no reason to believe it doesn't, > given that this wouldn'

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-07-26 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: vsavchenko, NoQ, steakhal. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus.

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-07-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. F18155698: image.png For more details please check out this html file: F18155704: stats.html Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106823/new

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-07-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 361793. martong added a comment. - Rename test functions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106823/new/ https://reviews.llvm.org/D106823 Files: clang/lib/StaticAnalyzer/Core/RangeConstraintManager

[PATCH] D106644: [clang][analyzer] Add standard streams to alpha.unix.Stream checker.

2021-07-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:215-236 +const VarDecl *findStdStreamDecl(StringRef StdName, CheckerContext &C) { + ASTContext &ACtx = C.getASTContext(); + + IdentifierInfo &II = ACtx.Idents.get(StdName); + auto Lo

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

2021-07-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @baloghadamsoftware Ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89380/new/ https://reviews.llvm.org/D89380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D104285: [analyzer] Retrieve value by direct index from list initialization of constant array declaration.

2021-07-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I like the idea and I think this is a valuable patch. However, because of the changes under `lib/AST` we need to add other reviewers who are responsible for those parts (e.g. aaronballman or rsmith). Is there really no way to workaround those changes? E.g. could we have

[PATCH] D106644: [clang][analyzer] Add standard streams to alpha.unix.Stream checker.

2021-07-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D106644#2913676 , @balazske wrote: > Split some type lookup functions from StdLibraryFunctionsChecker into > separate files. Thank you, this is awesome! Comment at: clang/lib/StaticAnalyzer/Checkers/Stream

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

2021-07-29 Thread Gabor Marton via Phabricator via cfe-commits
martong commandeered this revision. martong added a reviewer: baloghadamsoftware. martong added a comment. In D89380#2913750 , @whisperity wrote: > In D89380#2913664 , @martong wrote: > >> @baloghadamsoftware Ping.

[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables

2021-07-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. This is awesome! Comment at: clang/test/Analysis/copy-elision.cpp:9-10 +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -std=c++17 \ +// RUN:-analyzer-config elide-constructors=false -DNO_ELIDE_FLAG \ +// RUN:

[PATCH] D120824: [clang][ASTImporter] Fix a bug when importing CXXDefaultInitExpr.

2022-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. So, my understanding is that the issue stems from the fact that `hasInClassInitializer()` gave inconsistent results with `getInClassInitializer()` for previously imported nodes. Please confi

[PATCH] D120824: [clang][ASTImporter] Fix a bug when importing CXXDefaultInitExpr.

2022-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Okay, thanks for the explanation. > The in-class initializer expression is not always stored in the AST, in the > ToTU it is missing initially. The field has the flag set that it contains > in-class initializer but the actual expression is not set yet (probably > becau

[PATCH] D120824: [clang][ASTImporter] Fix a bug when importing CXXDefaultInitExpr.

2022-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D120824#3369563 , @balazske wrote: > > I think that the problem may be related to the fact that the in-class > initializer is not used by the code in the "To" AST (in > //ctu-cxxdefaultinitexpr.cpp// the problem is with `

[PATCH] D121176: [ASTStructuralEquivalence] Add support for comparing ObjCCategoryDecl.

2022-03-10 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Basically, this looks good to me. But my confidence with ObjC is low, so, I'd like @shafik as well to approve. Besides, seems like the pre-merge check fails with the new tests on Debian, could you please address that? Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D121387: [analyzer] ClangSA should tablegen doc urls refering to the main doc page

2022-03-21 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/utils/TableGen/ClangSACheckersEmitter.cpp:90-91 + + return (llvm::Twine("https://clang.llvm.org/docs/analyzer/checkers.html#";) + + CheckerFullName) .str(); > This patch will ensure that the doc ur

[PATCH] D122525: [clang][ASTImporter] Fix an import error handling related bug.

2022-04-11 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:8792-8794 +if (!isa(FromDi)) + if (auto *FromDiDC = dyn_cast(FromDi)) +if (FromDiDC->containsDecl(PrevFromDi)) balazske wrote: > martong wrote: > > We should ele

[PATCH] D123397: [clang][ASTImporter] Add import of attribute 'enable_if'.

2022-04-11 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123397/new/ https://reviews.llvm.org/D123397 _

[PATCH] D122525: [clang][ASTImporter] Fix an import error handling related bug.

2022-04-12 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Very good! Thanks for the update! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122525/new/ https://reviews.llvm.org/D122525

[PATCH] D122150: [clang][analyzer] Add checker for bad use of 'errno'.

2022-04-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D122150#3408156 , @balazske wrote: > This errno check will work if a state split is added at every standard > function that may set `errno` at failure. (The success and failure branches > have different //errno check state//,

<    5   6   7   8   9   10   11   12   13   14   >