[PATCH] D71642: [CFG] Add an option to inline CXXDefaultInitExpr into aggregate initialization

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 234436. xazax.hun marked 2 inline comments as done. xazax.hun added a comment. - Use range based for. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71642/new/ https://reviews.llvm.org/D71642 Files: clang/include/clang/Analysis/CFG.h clang/inc

[PATCH] D70836: [analysis] Fix value tracking for pointers to qualified types

2019-12-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Great! I have one question though. Will this also work as intended with sugared types? (e.g. typedefs) I believe this might be one of the main reason why the original author used canonical types in the first place. Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:472 +def PlacementNewChecker : Checker<"PlacementNew">, + HelpText<"Check if default placement new is provided with pointers to " + "sufficient storage capacity">,

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfe17b30a7957: [attributes][analyzer] Add annotations for handles. (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D70469?vs=234341&id=234940#toc Repository: rG LLVM Github

[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added a comment. Thanks for the review! :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70469/new/ https://reviews.llvm.org/D70469 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. xazax.hun marked 2 inline comments as done. Closed by commit rG82923c71efa5: [analyzer] Add Fuchsia Handle checker (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D70470?vs=233691&id=234948#toc

[PATCH] D70470: [analyzer] Add FuchsiaHandleCheck to catch handle leaks, use after frees and double frees

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thanks for the reviews! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70470/new/ https://reviews.llvm.org/D70470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thanks for the reviews! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70725/new/ https://reviews.llvm.org/D70725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D70725: [analyzer] Add path notes to FuchsiaHandleCheck

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG59878ec8092b: [analyzer] Add path notes to FuchsiaHandleCheck. (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D70725?vs=231996&id=234952#toc Repository: rG LLVM Github Mon

[PATCH] D71791: [CFG] Fix an assertion failure with static initializers

2019-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: Szelethus, NoQ. xazax.hun added a project: clang. Herald added subscribers: cfe-commits, Charusso, gamesh411, dkrupp, rnkovacs. The branches protecting the static initializers have a `DeclStmt` as last `Stmt`. Since it is not an expressi

[PATCH] D71791: [CFG] Fix an assertion failure with static initializers

2019-12-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 235161. xazax.hun added a comment. I decided to fix the unittests. Having CFGs full of dangling pointers to the AST does not look fun at all, so I think this change was long overdue. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71791/new/ https:

[PATCH] D71791: [CFG] Fix an assertion failure with static initializers

2019-12-23 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG379613d7c7fa: [CFG] Fix an assertion failure with static initializers (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D71791?vs=235161&id=235185#toc Repository: rG LLVM Git

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. If we disable the dependency of a checker explicitly I think we should at least emit a warning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75842/new/ https://reviews.llvm.org/D75842

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I am not sure if I would call this a bugfix. Enabling a checker without one of its dependency will potentially cause the checker to misbehave. I am uncomfortable changing the current behavior to a more dangerous one without any diagnostics. Including the diagnostic wi

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D75842#1912364 , @baloghadamsoftware wrote: > In D75842#1912293 , @xazax.hun wrote: > > > I am not sure if I would call this a bugfix. Enabling a checker without one > > of its depend

[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

2020-03-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:33-45 + enum KindTy { +Opened, /// Stream is opened. +Closed, /// Closed stream (an invalid stream pointer after it was closed). +OpenFailed /// The last open operation h

[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

2020-03-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:33-45 + enum KindTy { +Opened, /// Stream is opened. +Closed, /// Closed stream (an invalid stream pointer after it was closed). +OpenFailed /// The last open operation h

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

2020-03-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added reviewers: gribozavr2, ymandel. xazax.hun added a comment. Herald added a subscriber: ASDenysPetrov. Added some more reviewers who might be interested. I think it is very crucial to make the intentions clear, how do you define `definition` and `variable`? Other than assignments w

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

2020-03-18 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D76287#1929221 , @Szelethus wrote:d: > //Variable// could be practically anything that can be written, but due to > the nature of what we can work this, we have to make severe restrictions. > > - We don't really have a good p

[PATCH] D72810: [LifetimeAnalysis] Add support for lifetime annotations on functions

2020-03-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 251569. xazax.hun marked an inline comment as done. xazax.hun added a comment. - Rebase. - Address some review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72810/new/ https://reviews.llvm.org/D72810 Files: clang/include/clang/AST/Att

[PATCH] D72810: [LifetimeAnalysis] Add support for lifetime annotations on functions

2020-03-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 14 inline comments as done. xazax.hun added inline comments. Comment at: clang/include/clang/AST/LifetimeAttr.h:163 +// Maps each annotated entity to a lifetime set. +using LifetimeContracts = std::map; + aaron.ballman wrote: > xazax.hun wrote: >

[PATCH] D73966: [analyzer][WIP] Add 10.0.0 release notes.

2020-02-04 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/docs/ReleaseNotes.rst:429 + +- Numerous smaller false positive fixes. I'd just say `Numerous smaller fixes.` or `Numerous other improvements.` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D74003: [analyzer] Prevent assertion failure in PThreadLockChecker when the implementations of the locking functions are available

2020-02-04 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, jfb, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. This is very unlikely to happen for PThre

[PATCH] D74004: [analyzer] Move fuchsia.Lock checker to alpha

2020-02-04 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. After experimenting with it a bit it looks lik

[PATCH] D74003: [analyzer] Prevent assertion failure in PThreadLockChecker when the implementations of the locking functions are available

2020-02-04 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D74003#1858144 , @NoQ wrote: > That's a safe default behavior, but ideally you should see if the annotation > on the function can be applied after inlining. Like, it isn't necessarily > always applicable, but when it is, you

[PATCH] D74003: [analyzer] Prevent assertion failure in PThreadLockChecker when the implementations of the locking functions are available

2020-02-05 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe4f4a6c0f5bb: [analyzer] Prevent an assertion failure in PThreadLockChecker (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D74003?vs=242447&id=242778#toc Repository: rG LL

[PATCH] D74004: [analyzer] Move fuchsia.Lock checker to alpha

2020-02-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D74004#1858185 , @NoQ wrote: > Also you'll need to update release notes (D73966 > ) :) I think this was merged after the release branch was created (https://github.com/llvm/llvm-project/blo

[PATCH] D74004: [analyzer] Move fuchsia.Lock checker to alpha

2020-02-05 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG643dee903ceb: [analyzer] Move fuchsia.Lock checker to alpha (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D74004?vs=242452&id=242781#toc Repository: rG LLVM Github Monore

[PATCH] D73966: [analyzer] Add 10.0.0 release notes.

2020-02-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/docs/ReleaseNotes.rst:405 +- New checker: ``fuchsia.HandleChecker`` to detect leaks related to Fuchsia + handles. NoQ wrote: > D74004 > > 1) The checker is now in alpha. > 2) This checker wasn't enabled in th

[PATCH] D74131: [analyzer][taint] Add isTainted debug expression inspection check

2020-02-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Please add a test as well. Otherwise looks good. Comment at: clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp:97 .Case("clang_analyzer_express", &ExprInspectionChecker::analyzerExpress) +.StartsWith("clang_analyzer_isTainted", &Ex

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

2020-02-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:401 +return; + case nonloc::ConcreteIntKind: { +const llvm::APSInt &IntVal = V.castAs().getValue(); Dealing with only concrete ints might be a g

[PATCH] D71524: [analyzer] Support tainted objects in GenericTaintChecker

2020-02-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:268 CheckerContext &C) { - if (isTainted(State, E, C.getLocationContext()) || isStdin(E, C)) + if (isTainted(State, E, C.ge

[PATCH] D73536: [analyzer][taint] Remove taint from symbolic expressions if used in comparisons

2020-02-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I think a crucial part of the design is what would we do for the following case: if (x < y || x > z) return; // Here we might not have ranges for x when y and z were symbolic. mySink(x); // requires x to be in [0, 255] So would we warn for the code above? X

[PATCH] D73536: [analyzer][taint] Remove taint from symbolic expressions if used in comparisons

2020-02-07 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. You cannot always have constant bounds. E.g. a dynamically allocated array size might depend on a variable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73536/new/ https://reviews.llvm.org/D73536

[PATCH] D74735: [analyzer] Add support for CXXInheritedCtorInitExpr.

2020-02-18 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. If the AST is hard to work with would it make sense to try to change the AST a bit? Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:944 + if (Data) { +loc::MemRegionVal MV(static_cast(Data)); +if (SymbolRef Sym = MV.getAsSymbol(true)

[PATCH] D72380: [DataFlow] Factor two worklist implementations out

2020-01-16 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 238592. xazax.hun added a comment. - Fix typo. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72380/new/ https://reviews.llvm.org/D72380 Files: clang/include/clang/Analysis/FlowSensitive/DataflowValues.h clang/include/clang/Analysis/FlowSensit

[PATCH] D72380: [DataFlow] Factor two worklist implementations out

2020-01-17 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG05c7dc664809: [DataFlow] Factor two worklist implementations out (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D72380?vs=238592&id=238785#toc Repository: rG LLVM Github M

[PATCH] D69825: [Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation

2020-01-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added subscribers: phosek, NoQ, haowei, xazax.hun. xazax.hun added a comment. Hi! This patch breaks scan-build-py which parses the output of "-###" to get -cc1 command. There might be other tools with the same problems. Could we either remove `(in-process)` from `CC1Command::Print` or

[PATCH] D69825: [Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation

2020-01-18 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. There might be other tools parsing the output of `-###`. I think adding a line break in the output is better/easier than updating all those tools (amd making them potentially slower, not profiting from this patch). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72982/new/ https://reviews.llvm.org/D72982

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Do you have commit access or need someone to commit on your behalf? Also, in case your change made it into the clang 10 release branch this will need to be cherry picked there as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D72982#1831595 , @hans wrote: > Wait, do we really want the "(in-process)" marker to be written to a separate > line? I'm not sure that we do. Since the `-###` command had this property of emitting copy pastable `-cc1` inv

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D72982#1831817 , @hans wrote: > In D72982#1831648 , @xazax.hun wrote: > > > In D72982#1831595 , @hans wrote: > > > > > Wait, do we really want t

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D72982#1831976 , @hans wrote: > Sigh, what a mess. I totally agree and sorry for that :( >> In case it is printed on a separate line the current parsing happens to work >> in all versions of scan-build and this seemed to b

[PATCH] D72982: [Clang] Un-break scan-build after integrated-cc1 change

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D72982#1832029 , @aganea wrote: > In D72982#1832000 , @xazax.hun wrote: > > > Thanks! Alternatively we could try to push the changes to all three > > versions and revert this patch onc

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. In case the handle symbol dies too early, even

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 239469. xazax.hun added a comment. - Minor refactoring. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73151/new/ https://reviews.llvm.org/D73151 Files: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp clang/test/Analysis/fuchsia_han

[PATCH] D72810: [LifetimeAnalysis] Add support for lifetime annotations on functions

2020-01-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 239644. xazax.hun marked 10 inline comments as done. xazax.hun added a comment. - Address most of the review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72810/new/ https://reviews.llvm.org/D72810 Files: clang/include/clang/AST/Attr.

[PATCH] D72810: [LifetimeAnalysis] Add support for lifetime annotations on functions

2020-01-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 6 inline comments as done. xazax.hun added inline comments. Comment at: clang/include/clang/AST/LifetimeAttr.h:143 +using LifetimeContractSet = std::set; +using LifetimeContractMap = std::map; + gribozavr2 wrote: > These names are not descriptive

[PATCH] D73229: [analyzer] Improve FuchsiaHandleChecker's diagnostic messages

2020-01-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. I found that this information is useful when t

[PATCH] D73229: [analyzer] Improve FuchsiaHandleChecker's diagnostic messages

2020-01-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:363 } else -return ""; +return std::string{}; }); NoQ wrote: > What was

[PATCH] D73229: [analyzer] Improve FuchsiaHandleChecker's diagnostic messages

2020-01-23 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5911268e441c: [analyzer] Improve FuchsiaHandleChecker's diagnostic messages (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D73229?vs=239698&id=239924#toc Repository: rG LL

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, haowei. xazax.hun added a project: clang. Herald added subscribers: Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, jfb, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. Basically, the semantics of C11 and Fuchs

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:133-135 + static HandleState getWithoutError(HandleState S) { +return HandleState(S.K, nullptr); + } NoQ wrot

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked an inline comment as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/c11lock.c:1 +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.unix.C11Lock -verify %s + NoQ wrote: > NoQ wrote: > > I wouldn't mind `alpha.core` given t

[PATCH] D72810: [LifetimeAnalysis] Add support for lifetime annotations on functions

2020-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 14 inline comments as done. xazax.hun added inline comments. Comment at: clang/include/clang/AST/LifetimeAttr.h:163 +// Maps each annotated entity to a lifetime set. +using LifetimeContracts = std::map; + gribozavr2 wrote: > Generally, DenseMap a

[PATCH] D72810: [LifetimeAnalysis] Add support for lifetime annotations on functions

2020-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 240335. xazax.hun added a comment. - Address some review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72810/new/ https://reviews.llvm.org/D72810 Files: clang/include/clang/AST/Attr.h clang/include/clang/AST/LifetimeAttr.h clang/i

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 4 inline comments as done. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:133-135 + static HandleState getWithoutError(HandleState S) { +return HandleState(S.K, nullptr); + } xazax.hu

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 240337. xazax.hun added a comment. - Address review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73151/new/ https://reviews.llvm.org/D73151 Files: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp clang/test/Analysis/fuchs

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I've rerun this on Fuchsia and it got the same results as the previous approach :). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73151/new/ https://reviews.llvm.org/D73151 ___ cfe-commits mailing list cfe-commit

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 240624. xazax.hun marked 2 inline comments as done. xazax.hun added a comment. - Add more tests. - Move the C11 checker to alpha.core CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73376/new/ https://reviews.llvm.org/D73376 Files: clang/include/

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D73376#1839818 , @NoQ wrote: > I don't see any immediate solutions to the boilerplate that don't consist in > introducing better checker APIs. Eg., we could have introduced a > `LazyBugType` - a wrapper around `Optional` tha

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added inline comments. Comment at: clang/test/Analysis/c11lock.c:7 +enum { + thrd_success = 0, + thrd_error = 2 Strictly speaking, this is implementation defined. But the C11 implementations I am aware of a

[PATCH] D73151: [analyzer] Fix handle leak false positive when the handle dies too early

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc98d98ba9b0f: [analyzer] Fix handle leak false positive when the handle dies too early (authored by xazax.hun). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 240650. xazax.hun added a comment. - Add a FIXME. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73376/new/ https://reviews.llvm.org/D73376 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td clang/lib/StaticAnalyzer/Checkers/Pthrea

[PATCH] D73376: [analyzer] Add FuchsiaLockChecker and C11LockChecker

2020-01-27 Thread Gábor Horváth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf4c26d993bdc: [analyzer] Add FuchsiaLockChecker and C11LockChecker (authored by xazax.hun). Changed prior to commit: https://reviews.llvm.org/D73376?vs=240650&id=240678#toc Repository: rG LLVM Github

[PATCH] D73629: [analyzer] vfork checker: allow execve after vfork

2020-01-29 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp:109 "execvpe", + "execve", nullptr Well, this is not the case now, but I wonder if it would also make sense to sort this list alphabetically. CH

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. Overall looks good, some minor comments inline. Comment at: unittests/AST/ASTImporterTest.cpp:276 +// This will not create the file more than once. +createVirtualFile(ToAST.get(), It->FileName, It->Code); + --

[PATCH] D45050: [clang-tidy] New checker for not null-terminated result caused by strlen or wcslen

2018-03-29 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. you should always upload the whole diff, not just the last changes. https://reviews.llvm.org/D45050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45081: [analyzer] Remove the unused method declaration in `ValistChecker.cpp`.

2018-03-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. LG! Thanks! Repository: rC Clang https://reviews.llvm.org/D45081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

[PATCH] D37470: [analyzer] Handle ObjC messages conservatively in CallDescription

2017-10-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D37470#906717, @dcoughlin wrote: > I think it would be better to add a new > "test/Analysis/block-in-critical-section.m" file rather than enabling a > random alpha checker in a file that tests the analyzer core. My reasoning was that the

[PATCH] D37470: [analyzer] Handle ObjC messages conservatively in CallDescription

2017-10-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 120598. xazax.hun added a comment. - Added a separate test case as per Devin's suggestion https://reviews.llvm.org/D37470 Files: lib/StaticAnalyzer/Core/CallEvent.cpp test/Analysis/block-in-critical-section.m Index: test/Analysis/block-in-critical-s

[PATCH] D38844: [analyzer] Make issue hash related tests more concise

2017-10-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp:68 // (globals should not be invalidated, etc), hence the use of evalCall. - FnCheck Handler = llvm::StringSwitch(C.getCalleeName(CE)) -.Case("clang_analyzer_eval", &ExprIns

[PATCH] D39372: Make DiagnosticIDs::getAllDiagnostics static.

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I like the idea of making functions that can be static, static. Could you update the usages of this function as well? https://reviews.llvm.org/D39372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

[PATCH] D38801: [analyzer] In getSVal() API, disable auto-detection of void type as char type.

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I like the idea of making `ProgramState::getSVal(const MemRegion *)` symmetric to `ProgramState::getSVal(Loc)`. Just some philosophical questions which should probably be addressed in the future: But also I wonder, should we maintain all these overloads? I mean, a lot

[PATCH] D39423: [analyzer] Left shifting a negative value is undefined

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. Herald added subscribers: szepet, baloghadamsoftware, whisperity. The analyzer did not return an UndefVal in case a negative value was left shifted. I also added altered the UndefResultChecker to emit a clear warning in this case. Repository: rL LLVM https:/

[PATCH] D39422: [analyzer] pr34779: CStringChecker: Don't get crashed by non-standard standard library function definitions.

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. This patch looks good to me. I am wondering whether it would make sense to have some kind of warning (even in the frontend if not in the analyzer) for using standard functions with non-s

[PATCH] D39428: [Analyzer] As suggested, use value storage for BodyFarm

2017-10-31 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. Some minor nits otherwise LGTM! Comment at: include/clang/Analysis/AnalysisDeclContext.h:479 + /// Get a reference to {@code BodyFarm} instance. + BodyFarm& getBodyFarm(); The reference is on the

[PATCH] D38844: [analyzer] Make issue hash related tests more concise

2017-10-31 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp:68 // (globals should not be invalidated, etc), hence the use of evalCall. - FnCheck Handler = llvm::StringSwitch(C.getCalleeName(CE)) -.Case("clang_analyzer_eval", &ExprIns

[PATCH] D39422: [analyzer] pr34779: CStringChecker: Don't get crashed by non-standard standard library function definitions.

2017-10-31 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: test/Analysis/string-with-signedness.c:1 +// RUN: %clang_analyze_cc1 -Wno-incompatible-library-redeclaration -analyzer-checker=core,unix.cstring,alpha.unix.cstring -verify %s + NoQ wrote: > We do have a warning for th

[PATCH] D39438: [analyzer] Diagnose stack leaks via block captures

2017-10-31 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:145 + if (dyn_cast_or_null(Region->getMemorySpace())) { +ExplodedNode *N = C.generateErrorNode(); +if (!N) This will stop the analysis on this

[PATCH] D39452: [LibCrossTU] Adding code ownership

2017-10-31 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. In order to reduce the load on the other code owners, I would like to step up as an owner of the new library. https://reviews.llvm.org/D39452 Files: CODE_OWNERS.TXT Index: CODE_OWNERS.TXT === -

[PATCH] D37437: [analyzer] Fix some checker's output plist not containing the checker name

2017-10-31 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D37437#909537, @zaks.anna wrote: > Just to be clear, since this leads to regression to the checker API, I am > asking to look into other ways of solving this problem. For example, is there > a way to ensure that the checker names are set at

[PATCH] D39428: [Analyzer] As suggested, use value storage for BodyFarm

2017-10-31 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D39428#912126, @george.karpenkov wrote: > @xazax.hun I'm really not convinced: Unfortunately, the LLVM codebase right now does not strictly follow the style guide. But clang-format puts the references next to the variable (or function in

[PATCH] D39518: [analyzer] do not crash on libcxx03 call_once implementation

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/Analysis/BodyFarm.cpp:415 CallbackRecordDecl, CallArgs); - } else { + } else if (Callback->getType()->isRValueReferenceType() + || Callback->getType()->isLValueReferenceType()

[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. Herald added subscribers: szepet, baloghadamsoftware, whisperity. Add documentation to the recently added issue hash dumping function. Repository: rL LLVM https://reviews.llvm.org/D39543 Files: docs/analyzer/DebugChecks.rst Index: docs/analyzer/DebugCheck

[PATCH] D38844: [analyzer] Make issue hash related tests more concise

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D38844#911735, @NoQ wrote: > Hey, i just recalled that we have documentation for `ExprInspection` > functions in `docs/analyzer/DebugChecks.rst`, you may want to add your > function there as well :) Indeed, thanks for pointing this out! T

[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 121290. xazax.hun marked 2 inline comments as done. https://reviews.llvm.org/D39543 Files: docs/analyzer/DebugChecks.rst Index: docs/analyzer/DebugChecks.rst === --- docs/analyzer/DebugChec

[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: docs/analyzer/DebugChecks.rst:255 + int x = 1; + clang_analyzer_hashDump(x); // Hashed string of x on stderr. +} NoQ wrote: > Unlike `printState` and like all other functions, your function doesn't dump

[PATCH] D39551: [analyzer] Make __builtin_debugtrap() a sink

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. Herald added subscribers: szepet, baloghadamsoftware, whisperity. For some reason, `__builtin_debugtrap` is not a sink for the analyzer. I also added some test cases to demonstrate that `__builtin_trap` and `__builtin_unreachable` are handled properly. The former

[PATCH] D39551: [analyzer] Make __builtin_debugtrap() a sink

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In the meantime, I found this discussion: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20121015/153735.html It looks like the reasoning behind this intrinsic not being noreturn is that the user might continue the execution in the debugger. I think the main

[PATCH] D35068: [analyzer] Detect usages of unsafe I/O functions

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:382 +DescFile<"CheckSecuritySyntaxOnly.cpp">; + def DeprecatedBufferHandling : Checker<"DeprecatedBufferHandling">, +HelpText<"Warn on uses of deprecated buffer manipulating fu

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41 +static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN", "EWOULDBLOCK", + "SIGCLD", "SIGCHLD"}; Is this

[PATCH] D39551: [analyzer] Make __builtin_debugtrap() a sink

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun abandoned this revision. xazax.hun added a comment. In https://reviews.llvm.org/D39551#914360, @dcoughlin wrote: > I believe that the intent of `__builtin_debugtrap()` is to provide an > in-source mechanism so that the developer can trap into the debugger and then > continue executi

[PATCH] D33722: [clang-tidy] Add checker for undelegated copy of base classes

2017-11-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 121477. xazax.hun added a comment. - Dominic said he no longer have time to continue with this patch, so I commandeered this revision - Skip template instantiations - Do not attempt fix macro expansions - Do not attempt fix type aliases and typedef types -

[PATCH] D33722: [clang-tidy] Add checker for undelegated copy of base classes

2017-11-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 5 inline comments as done. xazax.hun added a comment. Two problems are not resolved. One is Aaron prefers to query some infor from the AST instead of relexing. The second is providing base initializers in the wrong order. I think there are other checks that do relexing in some c

[PATCH] D39603: [clang-tidy] Support relative paths in run-clang-tidy.py

2017-11-03 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. Herald added subscribers: baloghadamsoftware, whisperity. Currently relative paths wasn't supperted by run-clang-tidy.py I added the support, however I did not find any existing tests. Is it ok for this to land without a test or should I introduce one? https://

[PATCH] D33722: [clang-tidy] Add checker for undelegated copy of base classes

2017-11-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 121698. xazax.hun added a comment. - Do not warn for NonCopyable bases - Remove lexing https://reviews.llvm.org/D33722 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/CopyConstructorInitCheck.cpp clang-tidy/misc/CopyConstructorInitCheck.h cl

[PATCH] D33722: [clang-tidy] Add checker for undelegated copy of base classes

2017-11-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D33722#915440, @aaron.ballman wrote: > In the other cases, it is not clear that the re-lexed information should be > carried in the AST. In this case, I think it's pretty clear that the AST > should carry this information. Further, I don't

[PATCH] D33722: [clang-tidy] Add checker for undelegated copy of base classes

2017-11-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Also, bugprone might be a better module to put this? https://reviews.llvm.org/D33722 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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