[PATCH] D121602: [clang][dataflow] Model the behavior of non-standard optional constructors

2022-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:110 +return false; + auto TypeName = Type->getAsCXXRecordDecl()->getQualifiedNameAsString(); + return TypeName == "std::optional" || TypeName == "absl::optio

[PATCH] D121602: [clang][dataflow] Model the behavior of non-standard optional constructors

2022-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:264 + +[](const CXXMemberCallExpr *E, LatticeTransferState &State) { +assignOptionalValue(*E->getImplicitObjec

[PATCH] D121694: [clang][dataflow] Allow disabling built-in transfer functions for CFG terminators

2022-03-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, xazax.hun. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Terminators are handled specially in the transfer functions so w

[PATCH] D121694: [clang][dataflow] Allow disabling built-in transfer functions for CFG terminators

2022-03-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D121694#3382473 , @xazax.hun wrote: > The change itself looks good. But out of curiosity, could you give me an > example when we do not want to use the builtin transfer functions? Sure! Pretty much any plain-vanilla dataflow

[PATCH] D121694: [clang][dataflow] Allow disabling built-in transfer functions for CFG terminators

2022-03-15 Thread Yitzhak Mandelbaum 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 rG4633c02eb001: [clang][dataflow] Allow disabling built-in transfer functions for CFG… (authored by ymandel). Repository: rG LLVM Github Monorepo C

[PATCH] D121694: [clang][dataflow] Allow disabling built-in transfer functions for CFG terminators

2022-03-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D121694#3382683 , @xazax.hun wrote: > In D121694#3382587 , @ymandel wrote: > >> In D121694#3382473 , @xazax.hun >> wrote: >> >>> The change it

[PATCH] D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, xazax.hun. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. This patch introduces `DataflowModel`, a virtual base class for

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: tschuett, steakhal, rnkovacs, mgorny. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Chromium's implementation of assertions (`CHECK`, `DCHEC

[PATCH] D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 415817. ymandel added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121796/new/ https://reviews.llvm.org/D121796 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysi

[PATCH] D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:139 +/// Virtual base class for "dataflow models": reusable analysis components that +/// model a particular aspect of program sema

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 415821. ymandel added a comment. fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121797/new/ https://reviews.llvm.org/D121797 Files: clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckMode

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp:206 + +EXPECT_TRUE(Env.flowConditionImplies(*FooVal)); + }; gribozavr2 wrote: > Sorry, could you e

[PATCH] D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 415926. ymandel marked an inline comment as done. ymandel added a comment. adjust API in response to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121796/new/ https://reviews.llvm.org/D121796 Files:

[PATCH] D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:150-151 +///should relate to each other -- that is, how they should compose. Open +///questions include: Do we want to enabl

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 415936. ymandel marked an inline comment as done. ymandel added a comment. removed lattice dependency. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121797/new/ https://reviews.llvm.org/D121797 Files: clang/

[PATCH] D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. ymandel marked 2 inline comments as done. Closed by commit rGe0aefb4f9278: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis… (authored by ymandel

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Thanks for the review! Comment at: clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp:122 + void transfer(const Stmt *S, NoopLattice &, Environment &Env) { +M.transfer(S, Env); + }

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 416479. ymandel marked an inline comment as done. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121797/new/ https://reviews.llvm.org/D121797 Files: clang/include/cla

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 416494. ymandel marked 6 inline comments as done. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121797/new/ https://reviews.llvm.org/D121797 Files: clang/include/cla

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp:122 + void transfer(const Stmt *S, NoopLattice &, Environment &Env) { +M.transfer(S, Env); + } xazax.hun wrote: > ymandel wrote: > > xazax.hun wrot

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-18 Thread Yitzhak Mandelbaum 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 rGa36c2dd6d54c: [clang][dataflow] Add modeling of Chromium's CHECK functionality (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D121797#3392444 , @xbolva00 wrote: > Why this should be maintained and developed by LLVM/Clang developers and not > by Chromium? That's a good question. I think the short answer, that skirts around the issue, is that this is

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. What is the motivation for stashing the results of a match on a statement? Do we expect to encounter the same statement often? I thought the concern was more specific to re-matching particular types, like `std::optional`. For that, we could lazily store the declaration

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. This revision is now accepted and ready to land. Much clearer now, thanks for the changes! The only real question I have is what's the best design for the cache -- lambda or explicit pair. I leave it up to you. In D122121#3396096

[PATCH] D122129: [clang][dataflow] Model the behavior of optional and std swap

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp:1961 + )", + UnorderedElementsAre(Pair("check-1", "safe"), +

[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks, Gabor -- that's a really helpful summary! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121797/new/ https://reviews.llvm.org/D121797 ___ cfe-commits mailing list cfe-comm

[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, xazax.hun. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. This patch provides the user with the ability to disable all che

[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D122143#3396615 , @xazax.hun wrote: > Are smart pointers special? I would expect to see similar problems with > containers (or even a nested optional). No, they're not. You're quite right -- containers in general are a proble

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D122121#3396688 , @xazax.hun wrote: > Thanks! Did you have a chance whether this makes a difference in real world > scenarios? I'm mostly curious because I do not have a good mental model of > how the matchers are implemented

[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 417032. ymandel added a comment. Addressed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122143/new/ https://reviews.llvm.org/D122143 Files: clang/include/clang/Analysis/FlowSensitive/Models/Unche

[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 417033. ymandel added a comment. add fixme Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122143/new/ https://reviews.llvm.org/D122143 Files: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOption

[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. In D122143#3396729 , @xazax.hun wrote: > In D122143#3396695 , @ymandel wrote: > >> So, do you mean to add a FIXME to move to allowlist, or do you

[PATCH] D120360: [libTooling] Generalize string explanation as templated metadata

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG18440547d352: [libTooling] Generalize string explanation as templated metadata (authored by li.zhe.hua, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D120360: [libTooling] Generalize string explanation as templated metadata

2022-03-21 Thread Yitzhak Mandelbaum 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 rG9edeceaece60: [libTooling] Generalize string explanation as templated metadata (authored by li.zhe.hua, committed by ymandel). Repository: rG LLVM

[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.

2022-03-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 417243. ymandel marked an inline comment as done. ymandel added a comment. Addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122143/new/ https://reviews.llvm.org/D122143 Files: clang/include/

[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.

2022-03-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:31 +struct UncheckedOptionalAccessModelOptions { + /// Ignore optionals reachable by derefencing a smart pointer

[PATCH] D122231: [clang][dataflow] Add support for `value_or` in a comparison.

2022-03-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, xazax.hun. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. This patch adds limited modeling of the `value_or` method. Speci

[PATCH] D123586: [clang][dataflow] Weaken abstract comparison to enable loop termination.

2022-04-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Currently, when the framework is used with an analysis that does

[PATCH] D123586: [clang][dataflow] Weaken abstract comparison to enable loop termination.

2022-04-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D123586#3446956 , @xazax.hun wrote: > Yeah, this is a hard problem in general. This looks like a sensible > workaround for the short term, but I'm looking forward to a better solution. > I'm a bit worried that the memory mode

[PATCH] D123586: [clang][dataflow] Weaken abstract comparison to enable loop termination.

2022-04-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D123586#3449291 , @xazax.hun wrote: > In D123586#3449256 , @ymandel wrote: > >> In D123586#3446956 , @xazax.hun >> wrote: >> >>> Yeah, this is

[PATCH] D123586: [clang][dataflow] Weaken abstract comparison to enable loop termination.

2022-04-13 Thread Yitzhak Mandelbaum 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 rGbbcf11f5af98: [clang][dataflow] Weaken abstract comparison to enable loop termination. (authored by ymandel). Repository: rG LLVM Github Monorepo

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Ensure that the expressions associated with terminators are asso

[PATCH] D123961: [clang][dataflow] Do not crash on missing `Value` for struct-typed variable init.

2022-04-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Remove constraint that an initializing expression of struct type

[PATCH] D123961: [clang][dataflow] Do not crash on missing `Value` for struct-typed variable init.

2022-04-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:184-186 - // FIXME: The initializer expression must always be assigned a value. - // Replace this with an assert when we have sufficient coverage of - // language features. ---

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 423682. ymandel added a comment. address comments; move tests to proper locations Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123858/new/ https://reviews.llvm.org/D123858 Files: clang/lib/Analysis/FlowSens

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:123-136 + } else if (auto *CondVal = cast_or_null( + Env.getValue(Cond, SkipPast::None))) { +Env.

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 423690. ymandel added a comment. add comments to tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123858/new/ https://reviews.llvm.org/D123858 Files: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAn

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 423693. ymandel marked 2 inline comments as done. ymandel added a comment. added fixme Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123858/new/ https://reviews.llvm.org/D123858 Files: clang/lib/Analysis/Flo

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the review! Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:110 +// FIXME: The flow condition must be an r-value, so `SkipPast::None` should +// suffice. xazax.hun wrote: > I am still not

[PATCH] D123961: [clang][dataflow] Do not crash on missing `Value` for struct-typed variable init.

2022-04-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 423724. ymandel added a comment. extended comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123961/new/ https://reviews.llvm.org/D123961 Files: clang/lib/Analysis/FlowSensitive/Transfer.cpp clang/uni

[PATCH] D123961: [clang][dataflow] Do not crash on missing `Value` for struct-typed variable init.

2022-04-19 Thread Yitzhak Mandelbaum 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 rGeb2131bdbad3: [clang][dataflow] Do not crash on missing `Value` for struct-typed variable… (authored by ymandel). Repository: rG LLVM Github Monor

[PATCH] D124104: [clang][dataflow] Fix join implementation to handle flow conditions correctly.

2022-04-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. The current implementation mutates the environment as it perform

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 423945. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123858/new/ https://reviews.llvm.org/D123858 Files: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis

[PATCH] D123858: [clang][dataflow] Ensure well-formed flow conditions.

2022-04-20 Thread Yitzhak Mandelbaum 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 rGc8f822ad5195: [clang][dataflow] Ensure well-formed flow conditions. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging

2022-04-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 424045. ymandel added a comment. address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124104/new/ https://reviews.llvm.org/D124104 Files: clang/lib/Analysis/FlowSensitive/DataflowEnvironment

[PATCH] D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging

2022-04-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124104/new/ https://reviews.llvm.org/D124104 ___ cfe-commits mailing list cfe-comm

[PATCH] D119370: [clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef

2022-02-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp:197-198 } } else if (ReceivingExpr) { -if ((*InvocationParmType)->isRValueRefere

[PATCH] D119370: [clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef

2022-02-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd038faea4608: [clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef (authored by devjgm, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

[PATCH] D119745: [libTooling] Change Tranformer's consumer to take multiple changes

2022-02-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. This revision is now accepted and ready to land. Looks good. But, please add tests. Thanks! Comment at: clang/include/clang/Tooling/Transformer/Transformer.h:27 + using ChangesConsumer = std::function> Changes)>; -

[PATCH] D119745: [libTooling] Change Tranformer's consumer to take multiple changes

2022-02-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd1e3235f604d: [libTooling] Change Tranformer's consumer to take multiple changes (authored by li.zhe.hua, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://

[PATCH] D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging

2022-04-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 424909. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124104/new/ https://reviews.llvm.org/D124104 Files: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

[PATCH] D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging

2022-04-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 7 inline comments as done. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:356 + +return V1 == V2 || + Env1.flowConditionImplies(*V1) == Env2.flowConditionImplies(*V2);

[PATCH] D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging

2022-04-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 424916. ymandel marked an inline comment as done. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124104/new/ https://reviews.llvm.org/D124104 Files: clang/lib/Analysi

[PATCH] D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging

2022-04-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:356 + +return V1 == V2 || + Env1.flowConditionImplies(*V1) == Env2.flowConditionImplies(*V2);

[PATCH] D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging

2022-04-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. ymandel marked an inline comment as done. Closed by commit rG37b4782e3e53: [clang][dataflow] Fix `Environment::join`'s handling of flow-condition merging. (authored by

[PATCH] D124395: [clang][dataflow] Optimize flow condition representation

2022-04-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. This revision is now accepted and ready to land. Nice work. On the surface, this adds complexity to the system and so should be justified in terms of performance improvements. However, having read through the patch, I think it overall redu

[PATCH] D124540: [clang][dataflow] Perform structural comparison of indirection values in `join`.

2022-04-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. This patch changes `Environment::join`, in the case that two val

[PATCH] D124540: [clang][dataflow] Perform structural comparison of indirection values in `join`.

2022-04-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6c81b5723716: [clang][dataflow] Perform structural comparison of indirection values in `join`. (authored by ymandel). Changed prior to commit: https://reviews.llvm.org/D124540?vs=425567&id=425849#toc R

[PATCH] D124540: [clang][dataflow] Perform structural comparison of indirection values in `join`.

2022-04-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:357-365 +// FIXME: add unit tests that cover this statement. +if (auto *IndVal1 = dyn_cast(Val)) { + auto *IndVal2 = cast(It-

[PATCH] D123032: [clang][dataflow] Exclude protobuf types from modeling in the environment.

2022-05-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 426388. ymandel marked an inline comment as done. ymandel added a comment. added FIXME Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123032/new/ https://reviews.llvm.org/D123032 Files: clang/lib/Analysis/Flo

[PATCH] D124807: [clang][dataflow] Avoid assert for invalid cast to BoolValue

2022-05-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the patch! Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:1155 +// FIXME: Remove this test once it provides no additional test coverage. +TEST_F(FlowConditionTest, DoesNotAssertForImplicitCastToBool)

[PATCH] D124807: [clang][dataflow] Only skip ExprWithCleanups when visiting terminators

2022-05-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Nice!! As Gabor said, thank you for the detailed explanation (on top of the work to get this all done in a principled manner). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124807/new/ https

[PATCH] D124932: [clang][dataflow] Track `optional`s' values (i.e. contents) in `optional` model.

2022-05-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch adds partial

[PATCH] D124932: [clang][dataflow] Track `optional` contents in `optional` model.

2022-05-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427029. ymandel added a comment. remove stray newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124932/new/ https://reviews.llvm.org/D124932 Files: clang/lib/Analysis/FlowSensitive/Models/UncheckedOption

[PATCH] D124943: [clang][dataflow] Add flowConditionIsTautology function

2022-05-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. The code looks good, but what is the intended application? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124943/new/ https://reviews.llvm.org/D124943 ___ cfe-commits mailing list

[PATCH] D124952: [clang-tidy] Escape diagnostic messages before passing to `diag` in Transformer.

2022-05-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang-tools-extra. Messages generated by Transformer rules may have `%` in them,

[PATCH] D124952: [clang-tidy] Escape diagnostic messages before passing to `diag` in Transformer.

2022-05-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427126. ymandel added a comment. address reviewer comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124952/new/ https://reviews.llvm.org/D124952 Files: clang-tools-extra/clang-tidy/utils/TransformerCla

[PATCH] D124952: [clang-tidy] Escape diagnostic messages before passing to `diag` in Transformer.

2022-05-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124952/new/ https://reviews.llvm.org/D124952 ___ cfe-commits mailing list cfe-comm

[PATCH] D124952: [clang-tidy] Escape diagnostic messages before passing to `diag` in Transformer.

2022-05-04 Thread Yitzhak Mandelbaum 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 rG9a8d33dbd8a8: [clang-tidy] Escape diagnostic messages before passing to `diag` in Transformer. (authored by ymandel). Repository: rG LLVM Github M

[PATCH] D124932: [clang][dataflow] Track `optional` contents in `optional` model.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427296. ymandel added a comment. Fixed the FIXME Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124932/new/ https://reviews.llvm.org/D124932 Files: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAcc

[PATCH] D124932: [clang][dataflow] Track `optional` contents in `optional` model.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D124932#3492495 , @xazax.hun wrote: > Overall looks good to me. I am curious what will the strategy be to properly > support construction. Do you plan to introduce a customization point to > `Env.createValue` to give checks/m

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. Herald added subscribers: carlosgalvezp, mgorny. Herald added a project: All. Eugene.Zelenko retitled this revision from "[clang][tidy] New check for safe usage of `std::optional` and like types." to "[clang-tidy] New check for safe usage of `std::optional` and like

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D121120#3494085 , @xazax.hun wrote: > Most checks in Clang Tidy will run relatively quickly as they usually can do > most/all of their work in a single traversal. I wonder whether flow sensitive > checks will prove to be a bi

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427374. ymandel marked 2 inline comments as done. ymandel added a comment. Herald added a project: clang. address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121120/new/ https://reviews.llvm.o

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427377. ymandel marked 2 inline comments as done. ymandel added a comment. added fixme Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121120/new/ https://reviews.llvm.org/D121120 Files: clang-tools-extra/clan

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:38 + + auto HasOptionalCallDescendant = hasDescendant(callExpr(callee(cxxMethodDecl( + ofClass(anyOf(hasName("std::optional"), hasName("absl::optional"), -

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427381. ymandel added a comment. Factor out analysis code into separate function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121120/new/ https://reviews.llvm.org/D121120 Files: clang-tools-extra/clang-tid

[PATCH] D124965: [clang][dataflow] Centralize expression skipping logic

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. This revision is now accepted and ready to land. Thanks! Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:368 void Environment::setStorageLocation(const Expr &E, StorageLocation &Loc) { - assert(!isa

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427412. ymandel added a comment. reorder examples Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121120/new/ https://reviews.llvm.org/D121120 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cp

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-unchecked-optional-access.rst:29 + +Checking if a value exists, then accessing the value + -

[PATCH] D124965: [clang][dataflow] Centralize expression skipping logic

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:38-41 + if (auto *LHSValue = + dyn_cast_or_null(Env.getValue(LHS, SkipPast::Reference))) +if (auto *RHSValue = +dyn_cast_or_null(Env.getValue(RHS, SkipPast::Referen

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:84 + if (!BlockToOutputState || + BlockToOutputState->size() <= Context->getCFG().getExit().getBlockID()) +return

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427429. ymandel marked an inline comment as done. ymandel added a comment. add assert Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121120/new/ https://reviews.llvm.org/D121120 Files: clang-tools-extra/clang

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. In D121120#3494427 , @xazax.hun wrote: > Overall this looks good to me. However, I think this might not use the full > potential of the check itself. With the information that the dataflo

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 10 inline comments as done. ymandel added a comment. Thanks for the review! Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:39-45 + using dataflow::ControlFlowContext; + using dataflow::DataflowAnalysisContext; + using dataf

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427607. ymandel added a comment. address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121120/new/ https://reviews.llvm.org/D121120 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyMo

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 427610. ymandel added a comment. add fixme Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121120/new/ https://reviews.llvm.org/D121120 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp cla

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:84 + if (!BlockToOutputState || + BlockToOutputState->size() <= Context->getCFG().getExit().getBlockID()) +return; ymandel wrote: > sgatev

[PATCH] D125091: [clang][dataflow][NFC] Clarify guarantees on returned vector size for `runDataflowAnalysis`.

2022-05-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, xazax.hun. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Adjusts the comment to specify that the output vector's size mat

[PATCH] D121120: [clang-tidy] New check for safe usage of `std::optional` and like types.

2022-05-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D121120#3494137 , @ymandel wrote: > In D121120#3494085 , @xazax.hun > wrote: > >> Most checks in Clang Tidy will run relatively quickly as they usually can do >> most/all of their wor

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