[PATCH] D140021: [clang-tidy] Add configuration option to bugprone-unchecked-optional-access check.

2022-12-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: xazax.hun. Herald added subscribers: carlosgalvezp, rnkovacs. Herald added a reviewer: njames93. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang-tools-extra. The underlying model already

[PATCH] D140021: [clang-tidy] Add configuration option to bugprone-unchecked-optional-access check.

2022-12-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 482833. ymandel added a comment. simplify new test file to only include relevant cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140021/new/ https://reviews.llvm.org/D140021 Files: clang-tools-extra/clan

[PATCH] D140021: [clang-tidy] Add configuration option to bugprone-unchecked-optional-access check.

2022-12-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 482834. ymandel added a comment. comment tweaks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140021/new/ https://reviews.llvm.org/D140021 Files: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccess

[PATCH] D139737: [-Wunsafe-buffer-usage] Initiate Fix-it generation for local variable declarations

2022-12-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D139737#3993813 , @NoQ wrote: > In D139737#3991699 , @ymandel wrote: > >> 2. We (google) have a tool for changing the type of a variable which takes >> into account all cascading chang

[PATCH] D140020: [clang][dataflow] Improve optional model's support for ignoring smart pointers.

2022-12-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5d22d1f54836: [clang][dataflow] Improve optional model's support for ignoring smart pointers. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D140021: [clang-tidy] Add configuration option to bugprone-unchecked-optional-access check.

2022-12-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 rG98550df7b7bb: [clang-tidy] Add configuration option to bugprone-unchecked-optional-access… (authored by ymandel). Repository: rG LLVM Github Monor

[PATCH] D116377: [libTooling] Adds more support for constructing object access expressions.

2022-01-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 402663. ymandel marked 9 inline comments as done. ymandel added a comment. addressed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116377/new/ https://reviews.llvm.org/D116377 Files: clang/include/

[PATCH] D116377: [libTooling] Adds more support for constructing object access expressions.

2022-01-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp:78 + returns(qualType(references(type())); + const auto SmartPointer = qualType(hasDeclaration( + cxxRecordDecl(anyOf(KnownSmartPointer, QuacksLi

[PATCH] D116377: [libTooling] Adds more support for constructing object access expressions.

2022-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 402910. ymandel added a comment. extended list of pointer-like types Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116377/new/ https://reviews.llvm.org/D116377 Files: clang/include/clang/Tooling/Transformer/

[PATCH] D117579: Add assert on End iteration distance to Rewriter::getRewrittenText.

2022-01-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. Closed by commit rGbd1fac2fafd7: Add assert on End iteration distance to Rewriter::getRewrittenText. (authored by ahedberg, committed by ymandel). Repository: rG LLV

[PATCH] D116377: [libTooling] Adds more support for constructing object access expressions.

2022-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 402984. ymandel added a comment. Herald added a subscriber: JDevlieghere. fix bad previous snapshot Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116377/new/ https://reviews.llvm.org/D116377 Files: clang/inc

[PATCH] D116377: [libTooling] Adds more support for constructing object access expressions.

2022-01-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. Closed by commit rG0944c196c58f: [libTooling] Adds more support for constructing object access expressions. (authored by ymandel). Repository: rG LLVM Github Monorep

[PATCH] D118178: [clang][dataflow] Allow clients to disable built-in transfer functions.

2022-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sgatev. Herald added subscribers: tschuett, steakhal. ymandel requested review of this revision. Herald added a project: clang. These built-in functions build the (sophisticated) model of the code's memory. This model isn't used by all analy

[PATCH] D117939: [clang-tidy] Add more documentation about check development

2022-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Overall, this looks fantastic! You may want to consider (in a separate patch) mentioning godbolt.org, which is a great UI for interacting with clang-query and the AST. Example configuration: https://godbolt.org/z/v88W8ET19 In D117939#3266234

[PATCH] D118178: [clang][dataflow] Allow clients to disable built-in transfer functions.

2022-01-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 403296. ymandel added a comment. addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118178/new/ https://reviews.llvm.org/D118178 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalys

[PATCH] D118178: [clang][dataflow] Allow clients to disable built-in transfer functions.

2022-01-26 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 rG3595189217e6: [clang][dataflow] Allow clients to disable built-in transfer functions. (authored by ymandel). Changed prior to commit: https://revi

[PATCH] D117939: [clang-tidy] Add more documentation about check development

2022-01-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/Contributing.rst:362 +Private custom matchers are a good example of auxiliary support code for your check +that is best tested with a unit test. It will be easier to test your matchers or +other suppo

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-01-31 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. Please mention the (breaking) API changes to `runDataflowAnalysis`, etc. in the patch description. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:56 + /// operations. + class ValueModel { public: I really like this new name/API. Much clearer concept. Comment at: clang/include/

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-18 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/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:74-77 + auto *V = dyn_cast(&D); + if (V == nullptr) +return; + initGlobalVar(*V, Env); -

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-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/include/clang/Analysis/FlowSensitive/Solver.h:39 + /// All elements in `Vals` must be non-null. + virtual Result solve(llvm::DenseSet Vals) = 0; +}

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

2022-02-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. High level question: why use `Any` rather than templating? Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:68 +using AnyGenerator2 = std::shared_ptr>; + li.zhe.hua wrote: > Placeholder name; suggestions welcome. hmm.

[PATCH] D120510: [clang][dataflow] Add limits to size of modeled data structures in environment.

2022-02-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. ymandel requested review of this revision. Herald added a project: clang. Adds two new parameters to control the size of data structures modeled in the en

[PATCH] D120510: [clang][dataflow] Add limits to size of modeled data structures in environment.

2022-02-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D120510#3343935 , @xazax.hun wrote: >> Very large structs still ground the analysis to a halt. > > I had similar experience in the past with analyses that tried to represent > all values in structs eagerly. > > I think a bette

[PATCH] D120510: [clang][dataflow] Add limits to size of modeled data structures in environment.

2022-02-24 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 rG208c25fcbf48: [clang][dataflow] Add limits to size of modeled data structures in environment. (authored by ymandel). Repository: rG LLVM Github Mo

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 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/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:41 + /// + /// `Slvr` must not be null. + DataflowAnalysisContext(std::unique_ptr

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:43 + + auto Res = ConjunctionVals.try_emplace( + std::move(Key), xazax.hun wrote: > As far as I understand, we need to do the double lookup (`find` and l

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

2022-03-02 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 really good! Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:64 using TextGenerator = std::shared_ptr>; (and move down to afte

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sgatev. Herald added subscribers: tschuett, steakhal, mgrang, mgorny. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. This patch adds a simpe lattice used to collect source loctions. An

[PATCH] D120900: [clang][dataflow] Add `MatchSwitch` utility library.

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, gribozavr2. Herald added subscribers: tschuett, steakhal, mgorny. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Adds `MatchSwitch`, a library for simplifying implementation of t

[PATCH] D120900: [clang][dataflow] Add `MatchSwitch` utility library.

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 412693. ymandel added a comment. Adjust tests to use two different handlers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120900/new/ https://reviews.llvm.org/D120900 Files: clang/include/clang/Analysis/Flo

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

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

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 5 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/SourceLocationsLattice.h:56 +// Returns a string that represents the source locations of the lattice. +std::string DebugString(const SourceLocationsLat

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D120890#3357438 , @xazax.hun wrote: > Is there anything special about `SourceLocation`s? I wonder whether we just > want a templated `PowerSet` lattice and instantiate it with `SourceLocation`s. Not really. Just that we use t

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

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

[PATCH] D120900: [clang][dataflow] Add `MatchSwitch` utility library.

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Thanks for the fast review! Comment at: clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h:51 +template +using MatchSwitch = std::function; + xazax.hun wrote: > When we instantiate this w

[PATCH] D120489: [analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks like this broke the build. I'm getting: FAILED: tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CStringChecker.cpp.o /usr/bin/clang++-11 ... -std=c++14 -MD -MT tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangS

[PATCH] D120900: [clang][dataflow] Add `MatchSwitch` utility library.

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 412763. ymandel marked an inline comment as done. ymandel added a comment. moved to `MatchFinder::MatchResult`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120900/new/ https://reviews.llvm.org/D120900 Files:

[PATCH] D120489: [analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Can you rollback until a fix is found? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120489/new/ https://reviews.llvm.org/D120489 ___ cfe-commits mailing list cfe-commits@lists.l

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

2022-03-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Transformer/Transformer.h:116 + explicit Transformer(transformer::RewriteRuleWith Rule, + ConsumerFn Consumer); asoffer wrote: > li.zhe

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

2022-03-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 rG7ee97c24efab: [clang][dataflow] Add a lattice to track source locations. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D120900: [clang][dataflow] Add `MatchSwitch` utility library.

2022-03-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 rGc88deef0a721: [clang][dataflow] Add `MatchSwitch` utility library. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-06 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/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:154 + + // `X v (X ^ Y ^ ...)` is logically equivalent to `X`. The common conditions + // have al

[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

2022-03-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sgatev. Herald added subscribers: tschuett, steakhal. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. When pre-initializing fields in the environment, the code assumed that all fields of

[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

2022-03-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the review! That was impressively fast... :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121158/new/ https://reviews.llvm.org/D121158 ___ cfe-commits mailing list cf

[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

2022-03-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D121158#3365415 , @xazax.hun wrote: >> When pre-initializing fields in the environment, the code assumed that all >> fields of a struct would be initialized > > Was this assumption ever correct given that it was already skippi

[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

2022-03-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 413673. ymandel added a comment. Add test for recursive type case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121158/new/ https://reviews.llvm.org/D121158 Files: clang/include/clang/Analysis/FlowSensitive

[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

2022-03-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 413674. ymandel added a comment. switch to c++11 for test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121158/new/ https://reviews.llvm.org/D121158 Files: clang/include/clang/Analysis/FlowSensitive/Value.h

[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

2022-03-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D121158#3365494 , @ymandel wrote: > In D121158#3365415 , @xazax.hun > wrote: > >>> When pre-initializing fields in the environment, the code assumed that all >>> fields of a struct wo

[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

2022-03-07 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 rG18c84e2d325f: [clang][dataflow] Fix nullptr dereferencing error. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D121197: [clang][dataflow] Add analysis that detects unsafe accesses to optionals

2022-03-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Maybe add explanation to the patch description for move of `TestingSupport.h`? Also, mention that this just a core implementation, and fuller support is coming? Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessMod

[PATCH] D121197: [clang][dataflow] Add analysis that detects unsafe accesses to optionals

2022-03-08 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/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:20 +/// +/// FIXME: Consider separating the models from the unchecked acce

[PATCH] D99543: [clang-tidy] Allow opt-in or out of some commonly occuring patterns in NarrowingConversionsCheck.

2021-04-29 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/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst:51 + + Narrowing conversions from any type in this semicolon separat

[PATCH] D102185: Widen `name` stencil to support `TypeLoc` nodes.

2021-05-11 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, thanks! In D102185#2749279 , @steveire wrote: > Adding Yitzhak as a reviewer. I notice that at least the name of a > cxxBaseSpecifier is not

[PATCH] D116370: [clang][dataflow] Add multi-variable constant propagation example.

2021-12-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp:162 + } + Vars[Var] = ValueLattice::top(); + return Vars; sgatev wrote: > I believe this should be `bottom` as `ValueLattice::bot

[PATCH] D116370: [clang][dataflow] Add multi-variable constant propagation example.

2021-12-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 396684. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116370/new/ https://reviews.llvm.org/D116370 Files: clang/unittests/Analysis/FlowSensitive/CMakeLists.txt cla

[PATCH] D116369: [clang][dataflow] Add parameterized map lattice.

2022-01-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/MapLattice.h:92 + /// entry as it was in the source map. + LatticeJoinEffect join(const MapLattice &Other) { +LatticeJoinEffect Effect = LatticeJo

[PATCH] D116370: [clang][dataflow] Add multi-variable constant propagation example.

2022-01-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 397277. 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/D116370/new/ https://reviews.llvm.org/D116370 Files: clang/unittests/A

[PATCH] D116369: [clang][dataflow] Add parameterized map lattice.

2022-01-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. ymandel marked an inline comment as done. Closed by commit rG4dcc47aaeaf0: [clang][dataflow] Add parameterized map lattice. (authored by ymandel). Repository: rG LLV

[PATCH] D116370: [clang][dataflow] Add multi-variable constant propagation example.

2022-01-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 rG4950198116a5: [clang][dataflow] Add multi-variable constant propagation example. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D116377: [libTooling] Adds more support for constructing object access expressions.

2022-01-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 397356. ymandel added a comment. ignore implicit and add deprecations Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116377/new/ https://reviews.llvm.org/D116377 Files: clang/include/clang/Tooling/Transformer

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:36 +/// FIXME: Consider replacing this with a model that is more aligned with C++ +/// value categories. +enum class SkipPast { I'm not sure that value cat

[PATCH] D116834: [clang][dataflow] Change `transfer` function to update lattice element in place.

2022-01-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, gribozavr2. ymandel requested review of this revision. Herald added a project: clang. Currently, the transfer function returns a new lattice element, which forces an unnecessary copy on processing each CFG statement. Repository: r

[PATCH] D116834: [clang][dataflow] Change `transfer` function to update lattice element in place.

2022-01-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 398612. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116834/new/ https://reviews.llvm.org/D116834 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis

[PATCH] D116834: [clang][dataflow] Change `transfer` function to update lattice element in place.

2022-01-10 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 rG64f7b2d4bf92: [clang][dataflow] Change `transfer` function to update lattice element in place. (authored by ymandel). Repository: rG LLVM Github M

[PATCH] D117012: [clang][dataflow] Add transfer functions for data members and this pointers

2022-01-11 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:57 + if (const auto *MethodDecl = dyn_cast(&DeclCtx)) { +if (!MethodDecl->isStatic()) { +

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for looping me in. I'll try to take a detailed look later today. In the meantime, I'll note that we have something similar internally which I never got around to upstreaming. However, we chose to support arbitrarily many matchers, with this interface: const cl

[PATCH] D117123: [clang][dataflow] Add transfer functions for initializers

2022-01-12 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/lib/Analysis/FlowSensitive/Transfer.cpp:171 + +Value *InitExprVal = Env.getValue(*InitExpr, SkipPast::None); +if (InitExprVal == nullptr)

[PATCH] D117129: [clang-tidy] Extract Class IncluderClangTidyCheck

2022-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Overall, this change looks good and makes sense. But, it doesn't scale past 1 feature, which makes me a bit hesitant. I don't have another example offhand, but include-inserter is an arbitrary feature and I don't love conflating feature addition with the class hierarchy

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-12 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. Bravo! This is an impressively thorough job. Thanks for pushing through to completion! Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:263 +

[PATCH] D117129: [clang-tidy] Extract Class IncluderClangTidyCheck

2022-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D117129#3238441 , @LegalizeAdulthood wrote: > Another option would be to migrate this to `ClangTidyCheck` itself > and add a flag/option passed to the ClangTidyCheck c'tor to opt-in > to the feature? Right, I was wondering ab

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:263 + auto HandleConstructorInvocation = + makeRule(cxxConstructExpr(hasAnyArgument(ignoringImpCasts( +BasicStringViewConstructing

[PATCH] D117304: [clang][dataflow] Remove TestingSupport's dependency on gtest

2022-01-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. ymandel requested review of this revision. Herald added a project: clang. Users outside of the clang repo may use different googletest versions. So, it's better not to depend on llvm's googletest. This patch removes the dependenc

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:105 - assert(SubExpr != nullptr); +if (S->getCastKind() == CK_LValueToRValue) { auto *SubExprVal = Env.getValue(*SubExpr, SkipPast::Reference

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Sorry for the delay. Read through the whole thread today. I agree with Aaron -- we shouldn't add this until 1. we have a general interface 2. we're sure this serves a general audience As I mentioned in my previous reply, I have a working general interface that I shared

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Clarification: I'm totally fine with it existing privately, my concerns were with a public implementation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116518/new/ https://reviews.llvm.org/D116518 ___ cfe-commits ma

[PATCH] D117304: [clang][dataflow] Remove TestingSupport's dependency on gtest

2022-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 400543. ymandel added a comment. remove redundant assert. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117304/new/ https://reviews.llvm.org/D117304 Files: clang/unittests/Analysis/FlowSensitive/MultiVarCons

[PATCH] D116377: [libTooling] Adds more support for constructing object access expressions.

2022-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/unittests/Tooling/SourceCodeBuildersTest.cpp:373 +TEST(SourceCodeBuildersTest, BuildAccessSmartPointer) { + testBuilder(buildAccess, "Smart x; x;", "x->"); +} gribozavr2 w

[PATCH] D117304: [clang][dataflow] Remove TestingSupport's dependency on gtest

2022-01-17 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 rG875117ae7a21: [clang][dataflow] Remove TestingSupport's dependency on gtest (authored by ymandel). Changed prior to commit: https://reviews.llvm.o

[PATCH] D115235: [clang][dataflow] Implement a basic algorithm for dataflow analysis

2021-12-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/CMakeLists.txt:1 +set(LLVM_LINK_COMPONENTS + Support Why create a new sub directory? From what I've seen elsewhere, it seems uncommon. I'm fine either way, but want to be sure we

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: gribozavr2, sgatev, xazax.hun. Herald added subscribers: rnkovacs, mgorny. ymandel requested review of this revision. Herald added a project: clang. Adds a general-purpose framework to support testing of dataflow analyses. Repository: rG

[PATCH] D115235: [clang][dataflow] Implement a basic algorithm for dataflow analysis

2021-12-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:31 +/// states of its predecessor basic blocks. +TypeErasedDataflowAnalysisState computeBlockInputState( +std::vector> &BlockStates, should this be decl

[PATCH] D115452: Prevent abseil-cleanup-ctad check from stomping on surrounding context

2021-12-09 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115452/new/ https://reviews.llvm.org/D115452

[PATCH] D115452: Prevent abseil-cleanup-ctad check from stomping on surrounding context

2021-12-09 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 rGa1968d5341d7: Prevent abseil-cleanup-ctad check from stomping on surrounding context (authored by CJ-Johnson, committed by ymandel). Repository: r

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 393218. ymandel added a comment. responding to review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115341/new/ https://reviews.llvm.org/D115341 Files: clang/include/clang/Analysis/FlowSensitive/Typ

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. Thanks for the great comments and the fast response time! Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:134 + +transferBlock( +BlockStates, *Block, Env, Analysis, --

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 393221. ymandel marked 2 inline comments as done. ymandel added a comment. rebasing onto latest version of parent patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115341/new/ https://reviews.llvm.org/D115341

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 393460. ymandel added a comment. add missing build dependency Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115341/new/ https://reviews.llvm.org/D115341 Files: clang/include/clang/Analysis/FlowSensitive/Type

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-10 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 rG47d526d67e3c: [clang][dataflow] Add framework for testing analyses. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:47-48 +template () + << std::declval())> +std::ostream &operator<<(std::ostream &OS, This SFINAE guard doesn't work on some platforms,

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 393477. ymandel added a comment. Remove the SFINAE guard and add `operator<<` for `NoopLattice` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115341/new/ https://reviews.llvm.org/D115341 Files: clang/include

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-10 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 rG5a40df638181: [clang][dataflow] Add framework for testing analyses. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 393513. ymandel added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. renames the `testing` namespace to `test` cleans up the code the implementation of `operator<<` for dataflow state. Repository: rG LLVM Github Monorepo

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 393705. ymandel added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115341/new/ https://reviews.llvm.org/D115341 Files: clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis

[PATCH] D115341: [clang][dataflow] Add framework for testing analyses.

2021-12-11 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 rG93fbaa46c82a: Revert "Revert "[clang][dataflow] Add framework for testing analyses."" (authored by ymandel). Repository: rG LLVM Github Monorepo

[PATCH] D113917: Add infrastructure to support matcher names.

2021-12-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Aaron - agreed on the points about `StringRef` vs `std::string`. But, before I make that change, what did you think of moving to a more general method `getMatcherSpec` that returns an object? That object will provide the name (for now) and other data in the future (like

[PATCH] D115740: [clang][dataflow] Add simplistic constant-propagation analysis.

2021-12-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. Herald added a subscriber: mgorny. ymandel updated this revision to Diff 394325. ymandel added a comment. ymandel updated this revision to Diff 394417. ymandel updated this revision to Diff 394549. ymandel edited the summary of this revision. ymandel added reviewers:

[PATCH] D115740: [clang][dataflow] Add simplistic constant-propagation analysis.

2021-12-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 394568. ymandel added a comment. updated file header Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115740/new/ https://reviews.llvm.org/D115740 Files: clang/unittests/Analysis/FlowSensitive/CMakeLists.txt

[PATCH] D115740: [clang][dataflow] Add simplistic constant-propagation analysis.

2021-12-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 394566. ymandel added a comment. Coalesce all CP files into one test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115740/new/ https://reviews.llvm.org/D115740 Files: clang/unittests/Analysis/FlowSensi

[PATCH] D115740: [clang][dataflow] Add simplistic constant-propagation analysis.

2021-12-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 394594. ymandel marked an inline comment as done. ymandel added a comment. Responds to reviewer comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115740/new/ https://reviews.llvm.org/D115740 Files: cla

<    9   10   11   12   13   14   15   >