[PATCH] D86874: [analyzer] Fix ArrayBoundCheckerV2 false positive regarding size_t indexer

2020-09-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. About the whole raw offset and the related warning. There is a fundamental question: Should we warn at `&a[0][10]` ? void foo() { int a[10][10]; int *p0 = &a[9][9]; // OK int *p1 = &a[10][10]; // Out-of-bounds static_assert(&a[0][10] == &a[1][0]);

[PATCH] D86874: [analyzer] Fix ArrayBoundCheckerV2 false positive regarding size_t indexer

2020-09-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I am coping my comments that I've sent in mail, just in case. > However, in the checker, we don't check `byte offset < 0` directly. > We //simplify// the left part of the `byte offset < 0` inequality by > substracting/dividing both sides with the constant `C`, if the `by

[PATCH] D86660: Modifying ImportDeclContext(...) to ensure that we also handle the case when the FieldDecl is an ArrayType whose ElementType is a RecordDecl

2020-09-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. The key question is this: Why exactly does `1735: ExpectedDecl ImportedOrErr = import(From);` fails to do the import properly when called from ASTImporter::ImportDefinition? Would it be possible to debug that from your LLDB test cases? Maybe starting with the simpler te

[PATCH] D87097: [analyzer][StdLibraryFunctionsChecker] Do not match based on the restrict qualifier in C++

2020-09-04 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 rGfe0972d3e4a6: [analyzer][StdLibraryFunctionsChecker] Do not match based on the restrict… (authored by martong). Changed prior to commit: https://r

[PATCH] D87097: [analyzer][StdLibraryFunctionsChecker] Do not match based on the restrict qualifier in C++

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

[PATCH] D87081: [analyzer][StdLibraryFunctionsChecker] Elaborate the summary of fread and fwrite

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

[PATCH] D87004: [analyzer] Evaluate PredefinedExpressions

2020-09-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/eval-predefined-exprs.cpp:7-21 + clang_analyzer_dump(__func__); + clang_analyzer_dump(__FUNCTION__); + clang_analyzer_dump(__PRETTY_FUNCTION__); + // expected-warning@-3 {{&Element{"func",0 S64b,char}}} + // expe

[PATCH] D87004: [analyzer] Evaluate PredefinedExpressions

2020-09-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/eval-predefined-exprs.cpp:7-21 + clang_analyzer_dump(__func__); + clang_analyzer_dump(__FUNCTION__); + clang_analyzer_dump(__PRETTY_FUNCTION__); + // expected-warning@-3 {{&Element{"func",0 S64b,char}}} + // expe

[PATCH] D86736: [analyzer][NFC] Don't bind values to ObjCForCollectionStmt, replace it with a GDM trait

2020-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I don't have anymore immediate concerns, but I will need more time to comb through the rest of the patch in more details... hopefully I can do that in the following days. Comment at: clang/lib/StaticAnalyzer/Core/ProgramState.cpp:327 +using ObjCForLct

[PATCH] D86870: [analyzer] Add more tests for ArrayBoundCheckerV2

2020-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/out-of-bounds-false-positive.c:34 + +void symbolic_uint_and_int0(unsigned len) { + (void)a[len + 1]; // no-warning steakhal wrote: > martong wrote: > > steakhal wrote: > > > martong wrote: > > > > Hm

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-09-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 rGa787a4ed16d6: [analyzer][StdLibraryFunctionsChecker] Use Optionals throughout the summary API (authored by martong). Changed prior to commit: http

[PATCH] D86870: [analyzer] Add more tests for ArrayBoundCheckerV2

2020-09-01 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/test/Analysis/out-of-bounds-false-positive.c:34 + +void symbolic_uint_and_int0(unsigned len) { + (void)a[len + 1]; // no-warning ste

[PATCH] D86873: [analyzer][NFC] Refactor ArrayBoundCheckerV2

2020-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp:52 + /// Offset: SymIntExpr{conj{n, int}, +, 12, long long} + class RawOffsetCalculator final + : public MemRegionVisitor { Since you are already deep in

[PATCH] D86870: [analyzer] Add more tests for ArrayBoundCheckerV2

2020-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/out-of-bounds-false-positive.c:34 + +void symbolic_uint_and_int0(unsigned len) { + (void)a[len + 1]; // no-warning Hmm, this seems to be quite redundant with the `size_t` tests. Why is it not enough

[PATCH] D86874: [analyzer] Fix ArrayBoundCheckerV2 false positive regarding size_t indexer

2020-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > Note that we don't deal with wrapping here. Wrapping? Please elaborate. Comment at: clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp:226 + // No unsigned symbolic value can be less then a negative constant. + if (const auto SymbolicRoot =

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-09-01 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 289099. martong added a comment. - Support empty ranges Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86531/new/ https://reviews.llvm.org/D86531 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsCh

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 288958. martong added a comment. - Rebase to correct base Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86531/new/ https://reviews.llvm.org/D86531 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctions

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 288957. martong added a comment. - Revert "Add assert in getRanges" Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86531/new/ https://reviews.llvm.org/D86531 Files: clang/lib/StaticAnalyzer/Checkers/StdLibrar

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Just realized. There maybe cases when we'd like to give XMax to an arg constraint, but the type of the arg is Y (X may be a looked up type). One example for such is getchar, where the return type is Int, but we have a range constraint {0, UCharRangeMax}. Consequently, i

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1006 +return IntRangeVector{std::pair{b, *e}}; + return IntRangeVector{}; +} balazske wrote: > This return of empty vector and possibilit

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 288946. martong added a comment. - Add assert in getRanges Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86531/new/ https://reviews.llvm.org/D86531 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunction

[PATCH] D86736: [analyzer][NFC] Don't bind values to ObjCForCollectionStmt, replace it with a GDM trait

2020-08-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D86736#2247035 , @Szelethus wrote: > In D86736#2244365 , @martong wrote: > >>> For any other loops, in order to know whether we should analyze another >>> iteration, among other things,

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-28 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86531/new/ https://reviews.llvm.org/D86531 ___ cfe-commits mailing list cfe-commits@l

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

2020-08-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D72705#2238487 , @Szelethus wrote: > I debated this >

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

2020-08-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > Another solution for the problem is if the system calls are modeled in a way > that there is always a state split between error end non-error (we will have > a path where it is known that the specific variable can be only (for example) > NULL and this can be detected

[PATCH] D86736: [analyzer][NFC] Don't bind values to ObjCForCollectionStmt, replace it with a GDM trait

2020-08-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > For any other loops, in order to know whether we should analyze another > iteration, among other things, we evaluate it's condition. Which is a problem > for ObjCForCollectionStmt, because it simply doesn't have one Shouldn't we try to fix the ObjCForCollectionStmt in

[PATCH] D86135: [analyzer][MacroExpansion] Fix a crash where multiple parameters resolved to __VA_ARGS__

2020-08-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D86135#2235473 , @Szelethus wrote: > In D86135#2233611 , @martong wrote: > >>> The fundamental problem is, we simply can't ask Preprocessor what a macro >>> expands into without hacking

[PATCH] D86135: [analyzer][MacroExpansion] Fix a crash where multiple parameters resolved to __VA_ARGS__

2020-08-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:896-898 +RawLexer.reset(new Lexer(SM.getLocForStartOfFile(LocInfo.first), LangOpts, + MB->getBufferStart(), MacroNameTokenPos, +

[PATCH] D86660: Modifying ImportDeclContext(...) to ensure that we also handle the case when the FieldDecl is an ArrayType whose ElementType is a RecordDecl

2020-08-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:1755-1759 + QualType FromTy = ArrayFrom->getElementType(); + QualType ToTy = ArrayTo->getElementType(); + + FromRecordDecl = FromTy->getAsRecordDecl(); + ToRecordDecl = To

[PATCH] D86691: [analyzer] Fix wrong parameter name in printFormattedEntry

2020-08-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D86691#2242004 , @nullptr.cpp wrote: > @Szelethus @martong > Sorry to interrupt, I don't have commit access, can you help commit this and > D86334 ? > Yang Fan > Thanks! Yep, no problem, I'll

[PATCH] D86660: Modifying ImportDeclContext(...) to ensure that we also handle the case when the FieldDecl is an ArrayType whose ElementType is a RecordDecl

2020-08-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:1737 // If we are in the process of ImportDefinition(...) for a RecordDecl we // want to make sure that we are also completing each FieldDecl. There `ImportDefinition(...)` here

[PATCH] D86691: [analyzer] Fix wrong parameter name in printFormattedEntry

2020-08-27 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. In D86691#2241604 , @nullptr.cpp wrote: > In D86691#2241401 , @Szelethus wrote: > >> Nice, thank you! Did you stumble across this, or found it with a tool? >

[PATCH] D86533: (Urgent!) [release][docs][analyzer] Add 11.0.0. release notes

2020-08-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. LGTM! (At least those changes that involved me, perhaps it is better to wait for more LGs.) Comment at: clang/docs/ReleaseNotes.rst:471 + +- Improve the pre- and post cond

[PATCH] D86465: [analyzer][solver] Redesign constraint ranges data structure

2020-08-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D86465#2238379 , @vsavchenko wrote: > Here are some benchmarking results. > In docker: > F12777445: tiny.png > F12777444: small.png > Natively on my Mac

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-26 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:851 + } getPointerTy(ACtx); + class { + public: balazske wrote: > Why has this class different layout than `Ge

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker][NFC] Use Optionals throughout the summary API

2020-08-25 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 287680. martong added a comment. - Use FileCheck in the lit test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86531/new/ https://reviews.llvm.org/D86531 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFu

[PATCH] D86533: (Urgent!) [release][docs][analyzer] Add 11.0.0. release notes

2020-08-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/docs/ReleaseNotes.rst:490-491 + +- Added :ref:`on-demand parsing ` capability to cross translation + unit analysis. + whisperity wrote: > What's the proper way of naming this feature, @martong @dkrupp @xazax.hun?

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker] Use Optionals throughout the summary API

2020-08-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/std-c-library-functions-POSIX-lookup.c:14 +// declarations in a way that the summary is not added to the map. We expect no +// crashes (i.e. no optionals should be 'dereferenced') and no output. + Pro

[PATCH] D86533: (Urgent!) [release][docs][analyzer] Add 11.0.0. release notes

2020-08-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/docs/ReleaseNotes.rst:471 + +- Improve the pre- and post condition modeling of several hundred more standard + C functions. Umm, this is still an alpha command line option, plus we improved only the pre-condition

[PATCH] D86532: (Urgent!) [docs][analyzer] Add documentation for alpha.fuchsia.Lock and alpha.core.C11Lock

2020-08-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/docs/analyzer/user-docs/CrossTranslationUnit.rst:213 compile said TU are given in YAML format referred to as `invocation list`, and must be passed as an analyer-config argument. The index, which maps function USR names to sourc

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

2020-08-25 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 287640. martong added a comment. - Rebase to parent patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84415/new/ https://reviews.llvm.org/D84415 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctions

[PATCH] D86531: [analyzer][StdLibraryFunctionsChecker] Use Optionals throughout the summary API

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

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

2020-08-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:882 + const QualType SizePtrTy = getPointerTy(SizeTy); + const QualType SizePtrRestrictTy = getRestrictTy(SizePtrTy); balazske wrote: > martong wrote:

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

2020-08-24 Thread Gabor Marton via Phabricator via cfe-commits
martong planned changes to this revision. martong added a comment. Planning to rebase this on a dependent patch that uses an API with Optionals. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84415/new/ https://reviews.llvm.org/D84415 _

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

2020-08-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks @balazske for your comments, you always make an assiduous review! Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:350 + } else { +*this = Signature(Args, *RetTy); } balazske wrote:

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

2020-08-24 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 287409. martong marked 4 inline comments as done. martong added a comment. - Remove private ctor of Signature - Assert a valid signature in Signature::matces Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84415/n

[PATCH] D86135: [analyzer][MacroExpansion] Fix a crash where multiple parameters resolved to __VA_ARGS__

2020-08-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I can feel your pain. > The fundamental problem is, we simply can't ask Preprocessor what a macro > expands into without hacking really hard. Can you summarize what is the exact problem (or give a link to a discussion, etc)? Is it an architectural problem in Clang itse

[PATCH] D86445: [analyzer][RFC] Simplify MetadataSymbol representation and resolve a CStringChecker FIXME

2020-08-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:198 /// SymbolMetadata - Represents path-dependent metadata about a specific region. /// Metadata symbols remain live as long as they are marked as in use before

[PATCH] D86295: [analyzer] Reorder the layout of MemRegion and cache by hand for optimal size

2020-08-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D86295#2233068 , @martong wrote: > In D86295#2232005 , @steakhal wrote: > >> In D86295#2231760 , @NoQ wrote: >> >>> I mean, like, you can measure

[PATCH] D86295: [analyzer] Reorder the layout of MemRegion and cache by hand for optimal size

2020-08-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D86295#2232005 , @steakhal wrote: > In D86295#2231760 , @NoQ wrote: > >> I mean, like, you can measure the entire process with `time` or something >> like that. I believe @vsavchenko's d

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

2020-08-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Now I've update the patch to remove all the `if`s. And the optional types are now implicitly handled, so no such mistakes can be done that I had done previously. However, the patch is getting to affect the core of this Checker, so, perhaps I should split this into two p

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

2020-08-14 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 285682. martong added a comment. - Use Optionals through the Signature Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84415/new/ https://reviews.llvm.org/D84415 Files: clang/lib/StaticAnalyzer/Checkers/StdLib

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

2020-08-14 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. In D84415#2218084 , @balazske wrote: > Even some macro-like construct can improve readability. The current way of > adding functions is source of copy-paste errors because more things are

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

2020-08-14 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 285626. martong marked an inline comment as done. martong added a comment. - Use the shorter 'getPointerTy' Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84415/new/ https://reviews.llvm.org/D84415 Files: cla

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

2020-08-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D84415#2215780 , @vsavchenko wrote: > Off-topic: I really think that we should have some sort of DSL for that kind > of stuff. In a sense the API provided in the Checker itself is an (embedded) DSL. Or do you think about bein

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

2020-08-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @NoQ, @vsavchenko My apologies, somehow I forgot to add you as reviewers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84248/new/ https://reviews.llvm.org/D84248 ___ cfe-commits

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

2020-08-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added reviewers: NoQ, vsavchenko. martong added subscribers: vsavchenko, NoQ. martong added a comment. @NoQ, @vsavchenko My apologies, somehow I forgot to add you as reviewers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84415/new/ https:

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

2020-08-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:2040 + +if (ConstStructTimevalPtrTy && StructTimespecPtrTy) + // int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); balazske wrot

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

2020-08-13 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 285289. martong marked 2 inline comments as done. martong added a comment. - Handle minimum buffer sizes - Fix copy paste error Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84248/new/ https://reviews.llvm.org/

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

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

[PATCH] D85728: [Analyzer] Support for the new variadic isa<> and isa_and_not_null<> in CastValueChecker

2020-08-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:270-272 +default: + llvm_unreachable("Invalid template argument for isa<> or " + "isa_and_nonnull<>"); baloghadamsoftware wrote: > NoQ

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

2020-08-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D72705#2199333 , @balazske wrote: > Test results for tmux are available here >

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

2020-08-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D72705#2210255 , @balazske wrote: > More results in CodeChecker: emacs_errorreturn >

[PATCH] D85093: [analyzer] StdLibraryFunctionsChecker: Add support for new functions

2020-08-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. LGTM! Thanks for your work! Comment at: clang/test/Analysis/std-c-library-functions-arg-constraints.c:190 void test_notnull_symbolic2(FILE *fp, int *buf) { - if (!buf) //

[PATCH] D85319: [analyzer][RFC] Get info from the LLVM IR for precision

2020-08-11 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Frontend/FrontendActions.cpp:30 + // markers which are used by some LLVM analysis (e.g. AliasAnalysis). + CGO.OptimizationLevel = 2; // -O2 + xazax.hun

[PATCH] D85319: [analyzer][RFC] Get info from the LLVM IR for precision

2020-08-11 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 284760. martong added a comment. - Use /// comments in IRContext.h - Conjure the return value even if the funciton is pure - Set all CodeGen options to the default (except the opt level) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D85319: [analyzer][RFC] Get info from the LLVM IR for precision

2020-08-11 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 284738. martong added a comment. - Use custom, CSA specific pipeline - Rename runOptimizerPipeline to runPipeline - Add unittest for IRContext - Add BuildCodeGen to CSA's FrontendAction.h Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D85319: [analyzer][RFC] Get info from the LLVM IR for precision

2020-08-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Frontend/FrontendActions.cpp:30 + // markers which are used by some LLVM analysis (e.g. AliasAnalysis). + CGO.OptimizationLevel = 2; // -O2 + TODO overwrite ALL optimization related config. Ar

[PATCH] D85319: [analyzer][RFC] Get info from the LLVM IR for precision

2020-08-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:720 + F->getAttributes().hasFnAttribute(llvm::Attribute::ReadOnly)) +return; + NoQ wrote: > Before i forget: you still need to conjure th

[PATCH] D85319: [analyzer] Get info from the LLVM IR for precision

2020-08-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D85319#2197104 , @rjmccall wrote: > This seems a huge architectural change that we need to talk about. Yes, sure. I am open to and welcome any discussions and suggestions. This patch is just a prototype to demonstrate the usab

[PATCH] D85319: [analyzer] Get info from the LLVM IR for precision

2020-08-05 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added a comment. In D85319#2196648 , @whisperity wrote: > What will happen with the ability to analyse a translation unit whose target > was not part of `LLVM_TARGETS_TO_BUILD` of the current `clang` binar

[PATCH] D85319: [analyzer] Get info from the LLVM IR for precision

2020-08-05 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/IRContext.h:39-41 + // Get the LLVM code for a function. We use the complete versions of the + // constructors and desctructors in this overload. Use the

[PATCH] D85319: [analyzer] Get info from the LLVM IR for precision

2020-08-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 283254. martong added a comment. - Remove dummy test file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85319/new/ https://reviews.llvm.org/D85319 Files: clang/include/clang/CodeGen/CodeGenMangling.h clang

[PATCH] D85319: [analyzer] Get info from the LLVM IR for precision

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

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

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