[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, baloghadamsoftware wrote: > NoQ wrote: > > balazske wr

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

2020-05-28 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:697 if (auto *FD = dyn_cast(D)) { - if (S.matchesSignature(FD)) { + if (S.Sign.matches(FD) && S.validat

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

2020-05-28 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 266918. martong marked 4 inline comments as done. martong added a comment. - Rename: validate -> checkValidity, sanityCheck -> checkSpecificValidity - Rename: Summary::checkValidity -> validateByConstraints - Add more docs to the Summary class - Rename matches

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 267141. martong marked an inline comment as done. martong added a comment. - Rebase to D77066 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77148/new/ https://reviews.llvm.org/

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75665/new/ https://reviews.llvm.org/D75665 ___ cfe-commits mailing list cfe-commits@lists.ll

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 267177. martong marked 8 inline comments as done. martong added a comment. - Add comments, remove auto from 'for' loops, matches -> matchesAndSet Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77658/new/ https:/

[PATCH] D80786: Rename APIs in unittests/AST/Language.h in preparation to share them

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thank you for working on this. > moving into a clang::test namespace instead of prefixing the names +1 for this. We could go even further: `clang::test::ast` or `clang::unittest::ast`. Comment at: clang/unittests/AST/Language.h:23 + +enum UnittestLan

[PATCH] D80786: Rename APIs in unittests/AST/Language.h in preparation to share them

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Just out of curiosity. In what way do you prepare to share these test? For which component are you planning to reuse this test infrastructure? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80786/new/ https://reviews.llvm.o

[PATCH] D80786: Rename APIs in unittests/AST/Language.h in preparation to share them

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks! LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80786/new/ https://reviews.llvm.org/D80786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 267216. martong marked 2 inline comments as done. martong added a comment. - Remove SValBuilder param Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ https://reviews.llvm.org/D77066 Files: clang/inc

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:237 + SVal BufDynSize = + getDynamicSizeWithOffset(State, BufV, C.getSValBuilder()); + Szelethus wrote: > You can retrieve `SValBuilder` from

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbd03ef19beb8: [analyzer] ApiModeling: Add buffer size arg constraint (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ https:/

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG41928c97b6a1: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved (authored by martong). Changed prior to commit: https://reviews.llvm.org/D77148?vs=267141&id=267232#toc Rep

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG16506d789084: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints (authored by martong). Changed prior to commit: https://reviews.llvm.org/D77658?vs=267177&id=267243#toc Repository

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

2020-05-29 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/StdLibraryFunctionsChecker.cpp:739 + Optional FileTy = lookupType("FILE", ACtx); + Optional FilePtrTy, FilePtrRestrictTy; balazske wrote: >

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rG634258b80606: [analyzer] StdLibraryFunctionsChecker: Add support to lookup types (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D80016#2063234 , @xazax.hun wrote: > A high level comment. > > Trying to match function signatures is not a unique problem! In fact, almost > all of the checks the analyzer have is trying to solve the very some problem. > One

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

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

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-20 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3ff220de9009: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8340

[PATCH] D83970: [ASTImporter] Refactor ASTImporter to support custom downstream tests

2020-07-21 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. Ok, LGTM! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83970/new/ https://reviews.llvm.org/D83970

[PATCH] D84248: [analyzer][StdLibraryFunctionsChecker] Add POSIX time handling functions

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

[PATCH] D84415: [analyzer][StdLibraryFunctionsChecker] Add POSIX pthread handling functions

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

[PATCH] D83972: Modify ImportDefiniton for ObjCInterfaceDecl so that we always the ImportDeclContext one we start the definition

2020-07-24 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. > Unlike RecordDecl case which uses DefinitionCompleter to force > completeDefinition we don't seem to have a similar mechanism for > ObjCInterfaceDecl. It is unfortunate that the AST does

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

2020-07-24 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 280368. martong added a comment. - Rebase to master Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79431/new/ https://reviews.llvm.org/D79431 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecke

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

2020-07-24 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 4 inline comments as done. martong added a comment. In D79431#2020951 , @Szelethus wrote: > Sure, this is an improvement because we display more information, but I'd > argue that it isn't really a more readable warning message :) How about

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

2020-07-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:323 +std::string("Function argument constraint is not satisfied, ") + +VC->getName().data() + ", ArgN: " + std::to_string(VC->getArgNo()); if (!BT_Inva

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

2020-07-24 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 280376. martong marked 3 inline comments as done. martong added a comment. - Use Twine Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79431/new/ https://reviews.llvm.org/D79431 Files: clang/lib/StaticAnalyzer

[PATCH] D83174: Teach AttachPreviousImpl to inherit MSInheritanceAttr attribute

2020-07-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D83174#2158275 , @aaron.ballman wrote: > In D83174#2156454 , @v.g.vassilev > wrote: > > > >> Also, I would like to add that the current test present in this diff > > >> does not fail i

[PATCH] D84494: [Analyzer] Use of BugType in DereferenceChecker (NFC).

2020-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. AFAIK, BuiltinBug is deprecated and we should be using BugType anyway. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D83997: [os_log] Improve the way we extend the lifetime of objects passed to __builtin_os_log_format

2020-07-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:8000 return ExprWithCleanups::CleanupObject(cast(*R)); + } else if (auto *ICE = From.dyn_cast()) { +if (Expected R = Import(ICE)) I am not sure how this hunk is related to `os_lo

[PATCH] D83992: [ASTImporter] Add Visitor for TypedefNameDecl's

2020-07-28 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 for the test! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83992/new/ https://reviews.llvm.org/D83992 _

[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. Hera

[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: cl

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

2020-04-06 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added a comment. In D77410#1963288 , @Szelethus wrote: > LGTM! Maybe its worth glancing over the rest of the code (comments in > particular) whether anything would be outdated by this change. Yeah, seems

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

2020-04-06 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rG8f961399739f: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl (authored by martong). Changed prior to commit: https://reviews.llvm.

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

2020-04-06 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGab1fad8a3a8b: [analyzer] StdLibraryFunctionsChecker: Add test for function with default… (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

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

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

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

2020-04-07 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:570 +llvm::Optional +lookupGlobalCFunction(StringRef Name, const ASTContext &ACtx) { + IdentifierInfo &II = ACtx.Idents.get(Name)

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

2020-04-07 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: NoQ, Szelethus, balazske. 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 projec

[PATCH] D76605: [analyzer] Display the checker name in the text output

2020-04-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. I was just wondering if it would make sense to have a test with `display-checker-name=true`. Other than that, LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76605/new/ https:/

[PATCH] D77305: [Analyzer][VLASize] Support multi-dimensional arrays.

2020-04-08 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. LGTM, nice work! Comment at: clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp:163 + // Walk over the VLAs for every dimension until a non-VLA is found. + // Collect the sizes, put the most inner VLA to `VLALast`. +

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

2020-04-08 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77641#1969291 , @Szelethus wrote: > I suspect your change made compiler errors a bit nicer as well, so you don't > get one giant "Well, this huge single argument doesn't match any of the > assignment operators". The rea

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

2020-04-08 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77641#1969412 , @NoQ wrote: > So you only do the lookup in the global scope? What about `namespace std`? > > Do you also plan to support class methods by looking up the class first and > then looking up the method in the class

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

2020-04-08 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/StdLibraryFunctionsChecker.cpp:116 +/// Do sanity check on the constraint. +virtual bool validate(const FunctionDecl *) const { return true; } ArgNo

[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, > specially

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

2020-04-09 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:253 + + // FIXME Implement a generic negate for all BO values. + assert(Tmp.Op == BO_LE && "Op should be <="); -

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

2020-04-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I like it, nice work! Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:774 +Optional RangeConstraintManager::tryAssumeSymSymOp( +ProgramStateRef State, BinaryOperator::Opcode Op, SymbolRef LHSSym, Is it possibl

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

2020-04-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D75665#1971440 , @gamesh411 wrote: > In D75665#1907914 , @martong wrote: > > > The warning below suggests that we parse the ctu-other.c file (and > > presumably every file) as a C++ file

[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 https://reviews.llvm.

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

[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, > SV

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

[PATCH] D78189: [analyzer] StdLibraryFunctionsChecker: Add statistics

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: NoQ, Szelethus, balazske, 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 projec

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

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. The tests are getting better, thanks Endre! Comment at: clang/test/Analysis/ctu-on-demand-parsing.c:5 +// RUN: cp "%S/Inputs/ctu-other.c" "%t/ctu-other.c" +// RUN: echo '[{"directory":"%t","command":"gcc -c -std=c89 -Wno-visibility ctu-other.c","file":

[PATCH] D78126: [analyzer][NFC] Don't allow dependency checkers to emit diagnostics

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:153 +#undef CHECKER_DEPENDENCY +#undef GET_CHECKER_DEPENDENCIES + } Szelethus wrote: > Szelethus wrote: > > balazske wrote: > > > Probably too much of a

[PATCH] D78099: [analyzer][RetainCount] Tie diagnostics to osx.cocoa.RetainCount rather then RetainCountBase, for the most part

2020-04-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp:1500 +RefCountBug::KIND); + // TODO: Ideally, we should have a checker for each of these bug types. + INIT_BUGTYPE

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

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. Looks good to me! Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h:194 + const ProgramPointTag *Tag = nullptr) { +// Sa

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

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

[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 cfe-com

[PATCH] D80905: [analyzer] Introduce weak dependencies to express *preferred* checker callback evaluation order

2020-06-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 Kristof for working on this. Looks good to me as it is! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80905/new/ https://reviews.llv

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

2020-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D72705#2041779 , @balazske wrote: > I can make comparisons if more functions are added to the checker, `fputs` > only is not sufficient. Yes, you cannot measure just with fputs, similar thing happened to me with StdCLibraryF

[PATCH] D81916: [analyzer] Fix StdLibraryFunctionsChecker crash on macOS

2020-06-16 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D81916#2095106 , @NoQ wrote: > Thanks! > > @martong, thoughts on this? :) > > Also i guess in this test we're unable to obtain the value for `EOF`, what > would be a good fixme-test to demonstrate that? I accept this as a ver

[PATCH] D81745: [analyzer][MallocChecker] PR46253: Correctly recognize standard realloc

2020-06-16 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1071-1072 bool ShouldFreeOnFail) const { + // HACK: CallDescription currently recognizes non-standard realloc functions + // as standard because it d

[PATCH] D82940: [ASTReader][ASTWriter][PCH][Modules] Fix (de)serialization of SwitchCases

2020-07-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In case of the reproducer the problem is that we clear the switch ids in GetExternalDeclStmt. But we read the SwitchCase with the same ID twice from the same call of `GetExternalDeclStmt` (**//bold-italic//** in the below call stacks): - 1) clang::ASTReader::RecordSwi

[PATCH] D82940: [ASTReader][ASTWriter][PCH][Modules] Fix (de)serialization of SwitchCases

2020-07-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D82940#2125183 , @riccibruno wrote: > > I'm not certain I understand, but I'm removing my LG while we figure it > > out. Can you expound a bit further? > > Take a look at the AST dump of a small modification of the reduced test

[PATCH] D83009: [clang][Serialization] Don't duplicate the body of LambdaExpr during deserialization

2020-07-02 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. In D83009#2127106 , @vabridgers wrote: > I cherry picked this change and retried the case that was failing. This > change addresses the issue I was s

[PATCH] D82940: [ASTReader][ASTWriter][PCH][Modules] Fix (de)serialization of SwitchCases

2020-07-02 Thread Gabor Marton via Phabricator via cfe-commits
martong abandoned this revision. martong added a comment. Abandoning for a better fix in D83009 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82940/new/ https://reviews.llvm.org/D82940 __

[PATCH] D82288: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions

2020-07-02 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdb4d5f7048a2: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8

[PATCH] D83006: [ASTImporter] Add unittest case for friend decl import

2020-07-02 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, looks good! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83006/new/ https://reviews.llvm.org/D83006 __

[PATCH] D75740: [ASTImporter] Corrected import of repeated friend declarations.

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

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

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

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-08 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/test/Analysis/std-c-library-functions-POSIX.c:200 +#define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__; +#define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type#

[PATCH] D83475: [analyzer] Add CTUImportCppThreshold for C++ files

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

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 276715. martong added a comment. - Add getRestrictTy Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83407/new/ https://reviews.llvm.org/D83407 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsCheck

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 276716. martong marked 2 inline comments as done and an inline comment as not done. martong added a comment. - Remove redundant line from test code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83407/new/ https

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D83407#2141075 , @balazske wrote: > Are not some functions missing from the list (`shutdown`, `sockatmark`, > `socket`) (these come from )? And `getnameinfo` comes from > with many other functions that are not added.

[PATCH] D83475: [analyzer] Add CTUImportCppThreshold for C++ files

2020-07-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 276722. martong marked an inline comment as done. martong added a comment. - Remove extra whitespace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83475/new/ https://reviews.llvm.org/D83475 Files: clang/incl

[PATCH] D83475: [analyzer] Add CTUImportCppThreshold for C++ files

2020-07-09 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd12d0b73f1c9: [analyzer] Add CTUImportCppThreshold for C++ files (authored by martong). Changed prior to commit: https://reviews.llvm.org/D83475?vs=276722&id=276727#toc Repository: rG LLVM Github Mon

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-09 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:1735-1747 + if (!addToFunctionSummaryMap( + "accept", Summary(ArgTypes{IntTy, *StructSockaddrPtrRestrictTy, +

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 276759. martong added a comment. - Reuse summaries with accept and other functions when sockaddr is a union of pointers Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83407/new/ https://reviews.llvm.org/D83407

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-09 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/StdLibraryFunctionsChecker.cpp:1735-1747 + if (!addToFunctionSummaryMap( + "accept", Summary(ArgTypes{IntTy, *StructSockaddrPtrRestrictTy, +

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-10 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 276928. martong marked an inline comment as done. martong added a comment. - Make Signature to be an Optional member of the Summary Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83407/new/ https://reviews.llvm.

[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

2020-07-10 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/StdLibraryFunctionsChecker.cpp:328-329 struct Signature { -const ArgTypes ArgTys; -const QualType RetTy; +ArgTypes ArgTys; +QualType RetTy;

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

2020-06-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77658#2065174 , @MaskRay wrote: > `arc` adds many unneeded tags from Phabricator. You can drop `Reviewers:` > `Subscribers:` `Tags:` and the text `Summary:` with the following script: > > arcfilter () { > arc amend >

[PATCH] D82288: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions

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

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

2020-06-22 Thread Gabor Marton via Phabricator via cfe-commits
martong abandoned this revision. martong added a comment. Since D80016 we are able to look up types in the TU, so this patch is no longer needed. We'd like to be as precise with the function signatures as possible. Repository: rG LLVM Github Monorepo CHANGE

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

2020-06-22 Thread Gabor Marton via Phabricator via cfe-commits
martong abandoned this revision. martong added a comment. This patch is no longer needed because I am going to upstream the POSIX functions in groups, otherwise the patch would be hideously large. The groups are: file handling, networking, pthread_, mq_, dbm_, regex related, sched_, time, signa

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

2020-06-22 Thread Gabor Marton via Phabricator via cfe-commits
martong abandoned this revision. martong added a comment. Since D80016 we are able to look up types in the TU, so we can get the maximum value from the found type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7943

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

2020-06-23 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added a comment. In D79425#2022245 , @xazax.hun wrote: > I'd prefer to have this functionality committed together its first actual use > with tests. Okay, at the current state we add a summary individual

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

2020-06-23 Thread Gabor Marton via Phabricator via cfe-commits
martong abandoned this revision. martong marked an inline comment as done. martong added a comment. At the current state we add a summary individually for each name, that makes it easier to modify a summary for each function without effecting other functions. I'll add this functionality in the f

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

2020-06-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D79432#2022207 , @xazax.hun wrote: > I think testing summaries this way can be really hard to manage in the future. > I see two possible ways forward to make this easier: > a) Make something like https://reviews.llvm.org/D7811

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

2020-06-23 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/StdLibraryFunctionsChecker.cpp:1123-1124 + "abs", Summary(ArgTypes{IntTy}, RetType{IntTy}, EvalCallAsPure) + .Case({ArgumentCondition(0, Wi

[PATCH] D82288: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions

2020-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 8 inline comments as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:352-357 CmdLineOption, Szelethus wrote: > D78118#inline-723679 Please mark this `Hidden`. Ok, it missed my attention

[PATCH] D82288: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions

2020-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 273018. martong marked 4 inline comments as done. martong added a comment. - Add 'Hide' and 'InAlpha', move Off_tMax inside the brace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82288/new/ https://reviews.llv

[PATCH] D82288: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions

2020-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for the review guys! I understand there are concerns about `evalCall`, so I am trying to dissolve those concerns below. :) In D82288#2111206 , @Szelethus wrote: > I see a lot of `NoEvalCall`, but I wonder whether modifying

[PATCH] D82288: [analyzer][StdLibraryFunctionsChecker] Add POSIX file handling functions

2020-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > We use NoEvalCall in all functions in this patch I just now realized that it is actually not true, sorry about that. So, seems like `fnmatch`, `strcasecmp`, `strncasecmp` are `EvalCallAsPure`. I could skip them from this patch, if you guys consider this as dangerous a

[PATCH] D82561: [analyzer][CrossTU] Lower CTUImportThreshold default value

2020-06-26 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def:324 "for import when inlining functions during CTU analysis. " "Lowering this threshold can alleviate the memor

<    3   4   5   6   7   8   9   10   11   12   >