[PATCH] D77809: [Analyzer] Include typedef statements in CFG build.

2020-04-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. There must be a way to dump the CFG. Perhaps you could add a test that dumps the CFG of a given source and then by using `FileCheck` we could see the exact feature that is missing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77721: [ASTImporter] Add support for importing fixed point literals

2020-04-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. Hi Vince, this looks good to me! On the other hand I was pondering on @balazske's comment, this one: > Or use the new flag added to every item in DefaultTestValuesForRunOptions, >

[PATCH] D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc)

2020-03-16 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 250570. martong added a comment. - Fix the base commit of this patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71018/new/ https://reviews.llvm.org/D71018 Files: clang/lib/AST/ASTImporter.cpp

[PATCH] D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc)

2020-03-16 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 250568. martong added a comment. - Remove redundant VisitQualifiedTypeLoc and VisitAttributedTypeLoc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71018/new/ https://reviews.llvm.org/D71018 Files:

[PATCH] D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc)

2020-03-16 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D71018#1924604 , @martong wrote: > - Remove redundant VisitQualifiedTypeLoc and VisitAttributedTypeLoc I realized that the mentioned functions are redundant, because we have a while loop which iterates over all related

[PATCH] D77125: [Analyzer] Model return values of container insert and delete operations

2020-04-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77125#1955245 , @baloghadamsoftware wrote: > In D77125#1952769 , @martong wrote: > > > It seems like we could model here `emplace` and `emplace_after` exactly the > > same way we do

[PATCH] D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints

2020-03-25 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/StdLibraryFunctionsChecker.cpp:409 - Optional FoundSummary = findFunctionSummary(FD, CE, C); + for (const ValueConstraintPtr& VC : Summary.ArgConstraints) {

[PATCH] D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints

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

[PATCH] D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints

2020-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I just created a quick fix for the issue: https://reviews.llvm.org/D76790 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73898/new/ https://reviews.llvm.org/D73898 ___

[PATCH] D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints

2020-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I was thinking about the below test, but then I reverted back because I don't want to add "fake" summaries for testing purposes. Perhaps adding a new checker option could enable these "fake" summaries, @Szelethus what's your opinion? diff --git

[PATCH] D77410: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl

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

[PATCH] D77411: [analyzer] StdLibraryFunctionsChecker: Add test for function with default parameter

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

[PATCH] D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints

2020-03-25 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/StdLibraryFunctionsChecker.cpp:409 - Optional FoundSummary = findFunctionSummary(FD, CE, C); + for (const ValueConstraintPtr& VC : Summary.ArgConstraints) {

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2020-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:1 +#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" +#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"

[PATCH] D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints

2020-03-27 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 253174. martong added a comment. - Add tests with a subchecker Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76790/new/ https://reviews.llvm.org/D76790 Files:

[PATCH] D76996: [analyzer] Improve PlacementNewChecker

2020-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/placement-new.cpp:265 + + // bad 2(custom align) + 1(index '2' offset) + ::new ([1]) long; // expected-warning{{Storage type is aligned to 3 bytes but allocated type is aligned to 8 bytes}} expected-note 1 {{}}

[PATCH] D76996: [analyzer] Improve PlacementNewChecker

2020-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. LGTM! Thanks! But I am not that confident with the element regions and field regions, so @NoQ could you please take another look? Comment at:

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Do you have a lit test as well? It would be useful to have one that is similar to the one you mention in the review's summary. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:780 + if (AggressiveEraseModeling) { +if (const

[PATCH] D77125: [Analyzer] Model return values of container insert and delete operations

2020-03-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. It seems like we could model here `emplace` and `emplace_after` exactly the same way we do with `insert` and `insert_after`, couldn't we? Perhaps that could go into this patch too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved

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

[PATCH] D77012: [analyzer] Fix StdLibraryFunctionsChecker NotNull Constraint Check

2020-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. LGTM and thanks! In D77012#1948550 , @NoQ wrote: > Thanks! > > @Szelethus can we make this checker depend on undefined value checker > (probably CallAndMessage) so that uninitialized arguments

[PATCH] D76996: [analyzer] Improve PlacementNewChecker

2020-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Wohoow! I am impressed, this is really nice work, I like it! :) Could not find any glitch, looks good from my side once you address NoQ's concerns. Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:125 +Msg =

[PATCH] D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints

2020-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 253595. martong added a comment. - Test multiple constraints on the same arg Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76790/new/ https://reviews.llvm.org/D76790 Files:

[PATCH] D77061: [analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsChecker's dependency

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

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

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

[PATCH] D77061: [analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsChecker's dependency

2020-03-30 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1a1bb876dba4: [analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsCheckers… (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved

2020-04-01 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/test/Analysis/std-c-library-functions-arg-constraints.c:155 + __buf_size_arg_constraint_mul(buf, s, sizeof(short)); + clang_analyzer_eval(s * sizeof(short) <= 6); // \ + //

[PATCH] D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints

2020-04-01 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/D76790/new/ https://reviews.llvm.org/D76790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints

2020-04-02 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1525232e2761: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints (authored by martong). Changed prior to commit: https://reviews.llvm.org/D76790?vs=253595=254530#toc Repository: rG

[PATCH] D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.

2020-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:396 + /// yes was the value obtained or not. + mutable Optional> KernelZeroSizePtrValue; + Which one is referred to the lazy initialization? The inner or the outer?

[PATCH] D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.

2020-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1687 + if (ArgValKnown) { +if (!KernelZeroSizePtrValue) + KernelZeroSizePtrValue = balazske wrote: > martong wrote: > > martong wrote: > > > This is a bit

[PATCH] D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.

2020-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:396 + /// yes was the value obtained or not. + mutable Optional> KernelZeroSizePtrValue; + balazske wrote: > martong wrote: > > Which one is referred to the lazy

[PATCH] D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.

2020-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1687 + if (ArgValKnown) { +if (!KernelZeroSizePtrValue) + KernelZeroSizePtrValue = martong wrote: > This is a bit confusing for me. Perhaps alternatively we

[PATCH] D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR.

2020-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. Herald added a subscriber: rnkovacs. LGTM! Comment at: clang/test/Analysis/kmalloc-linux-1.c:15 + +// FIXME: malloc checker expects kfree with 2 arguments, is this

[PATCH] D78457: [analyzer][Z3-refutation] Fix a refutation BugReporterVisitor bug

2020-04-27 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. LGTM! Thanks for addressing the comments! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78457/new/ https://reviews.llvm.org/D78457 ___ cfe-commits mailing list

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:299 + "DisplayLoadedSummaries", + "If set to true, the checker displays all loaded summaries.", +

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 260651. martong added a comment. - Better description for the option in Checkers.td Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78118/new/ https://reviews.llvm.org/D78118 Files:

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D78118#1981592 , @Szelethus wrote: > This is a great idea, but the tests just seem to, well, test the new > functionality? > > On a different issue, take a look at how certain help related frontend flags > (not

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 260647. martong added a comment. - Rebase to master - Add the option to the lit test analyzer-config.c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78118/new/ https://reviews.llvm.org/D78118 Files:

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D78118#1988464 , @balazske wrote: > The new option will simply list the (found) functions that have a summary > based check enabled. (The term "Loaded" may be misleading in the current > implementation, somebody can think if

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 260687. martong added a comment. - Handle and test the display of signatures Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78118/new/ https://reviews.llvm.org/D78118 Files:

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D78118#2007943 , @martong wrote: > In D78118#1988464 , @balazske wrote: > > > The new option will simply list the (found) functions that have a summary > > based check enabled. (The

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > This is a great idea, but the tests just seem to, well, test the new > functionality? I updated the patch so now we have a new RUN line that checks with FileCheck. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D78704: [analyzer][NFC] Add unittest for FalsePositiveRefutationBRVisitor

2020-04-24 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Other than Whispy's nits, LGTM! Comment at: clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp:24 + do \ +if

[PATCH] D78457: [analyzer][Z3-refutation] Fix refutation BugReporterVisitor bug and refactor

2020-04-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:2869 + Constraints = CF.add(Constraints, Sym, C.second); +} else if (!OnlyForNewSymbols) { + // Overwrite the associated constraint of the Symbol. If

[PATCH] D78638: [analyzer] Consider array subscripts to be interesting lvalues

2020-04-22 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/PR53280338.cpp:1 +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s + AFAIK rdar is not accessible outside Apple. So, for the rest of the open source developers any

[PATCH] D75665: [analyzer] On-demand parsing capability for CTU

2020-04-22 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/CrossTU/CrossTranslationUnit.h:227 +/// Identifier. +virtual LoadResultTy load(StringRef Identifier) = 0; +virtual ~ASTLoader() = default; xazax.hun wrote: > martong wrote: > > xazax.hun

[PATCH] D78000: [ASTImporter] Fix handling of not defined FromRecord in ImportContext(...)

2020-04-22 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. LGTM! Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78000/new/ https://reviews.llvm.org/D78000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D76996: [analyzer] Improve PlacementNewChecker

2020-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:261 + + if (const VarRegion *TheVarRegion = BaseRegion->getAs()) { +const VarDecl *TheVarDecl = TheVarRegion->getDecl(); Perhaps you could call instead

[PATCH] D78704: [analyzer][NFC] Add unittest for FalsePositiveRefutationBRVisitor

2020-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I like it! Nice work! I have some minor comments. Comment at: clang/unittests/StaticAnalyzer/CheckerRegistration.h:81 +template +bool runCheckerOnCodeWithArgs(const std::string , std::string , + const std::vector ,

[PATCH] D78704: [analyzer][NFC] Add unittest for FalsePositiveRefutationBRVisitor

2020-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp:65 + + bool reportIfCanBeZero(const CallEvent , CheckerContext , + ProgramStateRef State) const { xazax.hun wrote: >

[PATCH] D78704: [analyzer][NFC] Add unittest for FalsePositiveRefutationBRVisitor

2020-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp:55 + + bool reachedWithNoContradiction(const CallEvent &, CheckerContext , + ProgramStateRef State) const { It

[PATCH] D78457: [analyzer][Z3-refutation] Fix refutation BugReporterVisitor bug and refactor

2020-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:2822 PathSensitiveBugReport ) { // Collect new constraints + addConstraints(EndPathNode, /*OnlyForNewSymbols=*/false); Probably you wanted to use

[PATCH] D78457: [analyzer][Z3-refutation] Fix refutation BugReporterVisitor bug and refactor

2020-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:2871 + // Overwrite the associated constraint of the Symbol. + Constraints = CF.remove(Constraints, Sym); Constraints = CF.add(Constraints, Sym, C.second);

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 260930. martong marked 2 inline comments as done. martong added a comment. - Use Decl::print and 'for: ' Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78118/new/ https://reviews.llvm.org/D78118 Files:

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-04-29 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 4 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:651 +// Get the declaration of a function proto as written in the source file. +StringRef ToString(const FunctionDecl

[PATCH] D76287: [analysis][analyzer] Introduce the skeleton of a reaching definitions calculator

2020-04-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/Analysis/ReachingDefinitions.cpp:269 + for (const CFGBlock *Succ : N->succs()) +Worklist.push_back(Succ); +} I understand that this is the worklist algorithm uplifted from Wikipedia. But how

[PATCH] D79330: [Analyzer][VLASizeChecker] Check for VLA size overflow.

2020-05-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/vla.c:107 + if (x == BIGINDEX) { +size_t s = sizeof(int[x][x][x][x]); // expected-warning{{Declared variable-length array (VLA) has too large size}} +return s; I think we could make the

[PATCH] D76996: [analyzer] Improve PlacementNewChecker

2020-05-04 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. > ... This draws a pattern that we should recursively descend down to the top > most base region. I.e. the different check*RegionAlign methods should call > into each other until we reach the top level base region. > The observation

[PATCH] D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints

2020-05-04 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 7 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:234-236 + // The signature of a function we want to describe with a summary. This is a + // concessive signature, meaning

[PATCH] D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints

2020-05-04 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 261855. martong marked 2 inline comments as done. martong added a comment. - Better encapsulate the data in a 'Summary' Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77658/new/ https://reviews.llvm.org/D77658

[PATCH] D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG62e747f61729: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls

2020-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77641#2004273 , @Szelethus wrote: > I think you can go ahead and commit. You seem to have a firm grasp on this > project, I believe your experience with ASTImporter has more then prepared > you for digging functions out of

[PATCH] D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls

2020-04-22 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/D77641/new/ https://reviews.llvm.org/D77641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-04-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77066#1953280 , @Charusso wrote: > Please avoid to stuff in `CheckerContext` because this facility should be > used by ExprEngine/Store as well. > Let us reword your API: `getDynamicSizeWithOffset(ProgramStateRef, SVal, >

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-04-14 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 257317. martong marked an inline comment as done. martong added a comment. - Rebase to master - Use BinaryOperator::negateComparisonOp - getBufferDynamicSize -> getDynamicSizeWithOffset Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77721: [ASTImporter] Add support for importing fixed point literals

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Looks good! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77721/new/ https://reviews.llvm.org/D77721 ___ cfe-commits mailing list

[PATCH] D78000: [ASTImporter] Fix handling of not defined FromRecord in ImportContext(...)

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Looks okay to me (other than the redundant import code that I have a comment about). > Also this seems to be testable via a Clang unit test, so I think this patch > should have one. Yeah, would be nice to have a Clang unit test. I believe we have the infrastructure

[PATCH] D78122: [analyzer][Nullability] Don't emit under the checker name NullabilityBase

2020-04-15 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/D78122/new/ https://reviews.llvm.org/D78122

[PATCH] D77866: [analyzer][CallAndMessage] Add checker options for each bug category

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77866#1983685 , @martong wrote: > Looks good to me! Just take care of the failures you have with harbourmaster, there seem to be CSA failures with the bot! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @NoQ Do these changes look okay to land? Thanks :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77641/new/ https://reviews.llvm.org/D77641 ___ cfe-commits mailing list

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

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

[PATCH] D79330: [Analyzer][VLASizeChecker] Check for VLA size overflow.

2020-05-13 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. In D79330#2033990 , @Szelethus wrote: > > Variable-length array (VLA) should have a size that fits into a size_t > > value. At least if the size is queried with sizeof, but it is better (and > >

[PATCH] D79072: [Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.

2020-05-13 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Herald added a subscriber: rnkovacs. In D79072#2026553 , @balazske wrote: > This change is relatively small and the refactoring like part (introduction > of `checkVLA` if I think correct?) is

[PATCH] D79330: [Analyzer][VLASizeChecker] Check for VLA size overflow.

2020-05-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D79330#2026564 , @balazske wrote: > I do not know if it would me **much** cleaner. > > - First part: Move calculation of `ArraySize` into `checkVLA` and rename > `checkVLASize` to `checkVLAIndexSize`. > - Second part: Add the

[PATCH] D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved

2020-05-05 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:229-234 BufferSizeConstraint(ArgNo BufArgN, ArgNo SizeArgN) : ValueConstraint(BufArgN), SizeArgN(SizeArgN) {} +

[PATCH] D79431: [analyzer] StdLibraryFunctionsChecker: Add better diagnostics

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

[PATCH] D79432: [analyzer] StdLibraryFunctionsChecker: Add summaries for libc

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

[PATCH] D79430: [analyzer] StdLibraryFunctionsChecker: Add LazyRanges to support type dependent Max

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

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

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

[PATCH] D79423: [analyzer][NFC] StdLibraryFunctionsChecker: Add empty Signatures

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

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-05 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/D77066/new/ https://reviews.llvm.org/D77066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D79420: [analyzer] Make NonNullParamChecker as dependency for StdCLibraryFunctionsChecker

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

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 262095. martong added a comment. - Rebase to master Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ https://reviews.llvm.org/D77066 Files:

[PATCH] D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved

2020-05-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 262098. martong marked 2 inline comments as done. martong added a comment. - Rebase to latest parent patch - Create BufSize constraints in a more descriptive way Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D79425: [analyzer] StdLibraryFunctionsChecker: Add overload for adding the same summary for different names

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

[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

[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] 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

[PATCH] D76996: [analyzer] Improve PlacementNewChecker

2020-05-14 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7c3768495e8c: [analyzer] Improve PlacementNewChecker (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76996/new/

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

2020-05-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I think this is a useful concept and it can nicely complement the ongoing summary based work in `StdLibraryFunctionsChecker`. Still, in my opinion, there are more discussions and work to be done here before we get to the final implementation. Our analyzer does not

[PATCH] D76996: [analyzer] Improve PlacementNewChecker

2020-05-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks, just committed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76996/new/ https://reviews.llvm.org/D76996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D79420: [analyzer] Make NonNullParamChecker as dependency for StdCLibraryFunctionsChecker

2020-05-14 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd061685a8304: [analyzer] Make NonNullParamChecker as dependency for… (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79420/new/

[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

2020-05-14 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGff4492c89feb: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries (authored by martong). Changed prior to commit: https://reviews.llvm.org/D78118?vs=260930=263992#toc

[PATCH] D79423: [analyzer][NFC] StdLibraryFunctionsChecker: Add empty Signatures

2020-05-14 Thread Gabor Marton via Phabricator via cfe-commits
martong planned changes to this revision. martong added a comment. We had a separate discussion with @xazax.hun. Let me summarize the outcome. We agreed that we should try our best to provide signatures for all functions (this affects child patches, particularly the POSIX related D79433

[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

[PATCH] D79423: [analyzer][NFC] StdLibraryFunctionsChecker: Add empty Signatures

2020-05-07 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 262620. martong added a comment. - Rename 'empty' -> 'irrelevant' Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79423/new/ https://reviews.llvm.org/D79423 Files:

[PATCH] D75063: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 6 inline comments as done. martong added inline comments. Herald added a subscriber: ASDenysPetrov. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:175 +using ValueConstraint::ValueConstraint; +bool CannotBeNull = true; +

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

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:221 +if (Handler) { + if (!C.wasInlined) { +if (Call.getNumArgs() > 1) { Perhaps putting this hunk into a separate function or lambda could

[PATCH] D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 11 inline comments as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:298 +def StdCLibraryFunctionArgsChecker : Checker<"StdCLibraryFunctionArgs">, + HelpText<"Check constraints of arguments of C standard

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