[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467611. ymandel added a comment. fix typos Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files:

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 6 inline comments as done. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:527-528 +auto *Prop2 = Val2.getProperty("has_value"); +return Prop1 == Prop2 || (Prop1 != nullptr && Prop2 !=

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467609. ymandel added a comment. Added FIXMEs for noted issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files:

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467589. ymandel marked an inline comment as done. ymandel added a comment. added another test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files:

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 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/DataflowAnalysisContext.h:157 + TopValue () { +return takeOwnership(std::make_unique()); + } xazax.hun wrote: > gribozavr2

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467513. ymandel added a comment. Add explicit test for creation of multiple tops. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files:

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467510. 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/D135397/new/ https://reviews.llvm.org/D135397 Files:

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 11 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp:237-238 + case Value::Kind::Top: +// Nothing more to do. Each `Top` instance will be mapped to a fresh +//

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 466124. ymandel marked an inline comment as done. ymandel added a comment. Address (most) comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files:

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the thorough reviews! Agreed on all points, and will address. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:157 + TopValue () { +return takeOwnership(std::make_unique()); + }

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: martong, rnkovacs. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Currently, our boolean formulas

[PATCH] D130130: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in-decls

2022-09-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Note: fixed typo in doc in followup commit 40f5c634bc991510427e274ba49d4c56f29ef593 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130130/new/

[PATCH] D130130: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in-decls

2022-09-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9a4e52ebeb6d: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in… (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D130130: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in-decls

2022-09-30 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/ReleaseNotes.rst:108-111 +- The :doc:`readability-avoid-const-params-in-decls + ` check does not + warn about const value

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0b12efc7a42c: [clang][dataflow] Add support for nested method calls. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134432/new/

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 462263. ymandel added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134432/new/ https://reviews.llvm.org/D134432 Files: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 462153. ymandel added a comment. formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134432/new/ https://reviews.llvm.org/D134432 Files: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: martong, rnkovacs. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Extend the context-sensitive analysis to

[PATCH] D131688: [clang][dataflow][NFC] Remove LatticeJoinEffect from framework interfaces

2022-09-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D131688#3716467 , @xazax.hun wrote: > Returning whether the lattice was changed can be a nice optimization when > comparing lattice elements is expensive. On the other hand, it can be one > more source of errors. I am fine

[PATCH] D130270: [clang][dataflow] Use a dedicated bool to encode which branch was taken

2022-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D130270#3780705 , @samestep wrote: > @ymandel Huh, interesting! I'll go ahead and abandon this patch, then? Please. Sorry I didn't catch this earlier! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D130270: [clang][dataflow] Use a dedicated bool to encode which branch was taken

2022-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel requested changes to this revision. ymandel added a comment. This revision now requires changes to proceed. It turns out that this change wasn't necessary. I've deleted the relevant FIXME in https://reviews.llvm.org/rGabc16c7a5b0a63d14172262153608b3d24de957f. AFAICT, the reason that the

[PATCH] D133588: [NFC] Remove a FIXME fixed by an earlier patch.

2022-09-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 rGabc16c7a5b0a: [NFC] Remove a FIXME fixed by an earlier patch. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D133588: [NFC] Remove a FIXME fixed by an earlier patch.

2022-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sgatev. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Commit 28bd7945eabdbde2b1fc071ab2f9b78e6e754a1a

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:652 ASTContext ) { -ASSERT_THAT(Results, ElementsAre(Pair("p4", _), Pair("p3", _), -

[PATCH] D132377: [clang][dataflow] Add `SetupTest` parameter for `AnalysisInputs`.

2022-08-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:191 + AnalysisOutputs AO{AnnotatedCode, Context, Target, CFCtx, + Analysis, InitEnv, {}}; + if (AI.SetupTest) {

[PATCH] D131645: [clang][dataflow] Allow user-provided lattices to provide a widen operator

2022-08-11 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/TypeErasedDataflowAnalysisTest.cpp:119 + std::unique_ptr AST = + tooling::buildASTFromCodeWithArgs("int x =

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-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! Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:180 + assert(Block->pred_size() == 2); + BackEdge = Pred; +}

[PATCH] D128807: [clang][transformer] Finish plumbing `Note` all the way to the output.

2022-08-10 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128807/new/ https://reviews.llvm.org/D128807

[PATCH] D131438: [clang][dataflow] Analyze constructor bodies

2022-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:224 // FIXME: Support references here. - Env.ReturnLoc = Env.getStorageLocation(*Call, SkipPast::Reference); + ReturnLoc = getStorageLocation(*Call, SkipPast::Reference);

[PATCH] D131438: [clang][dataflow] Analyze constructor bodies

2022-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:219-245 // FIXME: Support references here. - Env.ReturnLoc = Env.getStorageLocation(*Call, SkipPast::Reference); + ReturnLoc = getStorageLocation(*Call, SkipPast::Reference);

[PATCH] D128807: [clang][transformer] Finish plumbing `Note` all the way to the output.

2022-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D128807#3627625 , @courbet wrote: > In D128807#3625676 , @ymandel wrote: > >>> For my particular case, I just need multiple notes per rule. I don't need >>> them to be associated to a

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D131280#3709964 , @xazax.hun wrote: > In D131280#3709781 , @ymandel wrote: > >> Thanks. That looks good, but I'm concerned that it only counts the arguments >> and doesn't look at

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D131280#3706988 , @xazax.hun wrote: > In D131280#3706915 , @ymandel wrote: > >> Sure. This is probably worth some discussion. Fully qualified names, however >> we define them, will

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 451145. ymandel marked 9 inline comments as done. ymandel added a comment. fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131280/new/ https://reviews.llvm.org/D131280 Files:

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 451144. ymandel marked an inline comment as done. ymandel added a comment. respond to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131280/new/ https://reviews.llvm.org/D131280 Files:

[PATCH] D131438: [clang][dataflow] Analyze constructor bodies

2022-08-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/unittests/Analysis/FlowSensitive/TransferTest.cpp:4371 +TEST(TransferTest, ContextSensitiveConstructorBody) { + std::string Code = R"(

[PATCH] D131438: [clang][dataflow] Analyze constructor bodies

2022-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks good overall. I want to think a bit more about potential additional tests... Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:232 +// This case is disallowed by the precondition from the method docstring. +

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. In D131280#3706836 , @xazax.hun wrote: > The concept of fully qualified name is somewhat ambiguous for me. Do we > expect the user to specify inline namespaces as well? I'd love to see

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 450823. ymandel added a comment. Address reviewer comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131280/new/ https://reviews.llvm.org/D131280 Files:

[PATCH] D131390: [clang-tidy] Fix a regression of readability-container-size-empty after the AST ElaboratedType change.

2022-08-08 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! It makes me a little sad that `QualType` has both `isIntegerType` and `isIntegralType`. Nice spotting that difference! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 450353. ymandel added a comment. add comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131280/new/ https://reviews.llvm.org/D131280 Files: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h

[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

2022-08-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: samestep, xazax.hun, sgatev. Herald added subscribers: martong, rnkovacs. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. This patch evolves the cache of

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:38 + + // DEPRECATED. Use overload above. static llvm::Expected build(const Decl *D, Stmt *S, xazax.hun

[PATCH] D131170: [clang][dataflow] Analyze method bodies

2022-08-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Nice!! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131170/new/ https://reviews.llvm.org/D131170 ___ cfe-commits mailing list

[PATCH] D131109: [clang][dataflow][NFC] Fix outdated comment on getStableStorageLocation

2022-08-03 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131109/new/ https://reviews.llvm.org/D131109

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-03 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 rG692e03039d1e: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls. (authored by ymandel). Repository: rG LLVM Github Monorepo

[PATCH] D130600: [clang][dataflow] Handle return statements

2022-08-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Please ignore my previous comments from an earlier revision. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 ___ cfe-commits mailing

[PATCH] D130600: [clang][dataflow] Handle return statements

2022-08-03 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:134 StorageLocation *ThisPointeeLoc = nullptr; + StorageLocation *ReturnLoc =

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

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

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:34 + /// Builds a ControlFlowContext from an AST node. `D` is the function in which + /// `S` resides. All arguments must be non-null. static llvm::Expected

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

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

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 449658. ymandel marked 2 inline comments as done. ymandel added a comment. update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131039/new/ https://reviews.llvm.org/D131039 Files:

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 449649. ymandel added a comment. adusted interface to return (nullable) pointer rather than reference. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131039/new/ https://reviews.llvm.org/D131039 Files:

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 449648. ymandel marked 4 inline comments as done. ymandel added a comment. addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131039/new/ https://reviews.llvm.org/D131039 Files:

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-03 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/ControlFlowContext.h:34 + /// Builds a ControlFlowContext from an AST node. `D` is the function in which + /// `S` resides. All arguments must be

[PATCH] D131021: [clang][dataflow] Rename member to make it clear that it isn't stable

2022-08-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131021/new/ https://reviews.llvm.org/D131021 ___ cfe-commits mailing list

[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

2022-08-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, samestep, sgatev, gribozavr. Herald added subscribers: martong, tschuett, rnkovacs. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. This patch

[PATCH] D130726: [clang][dataflow] Handle multiple context-sensitive calls to the same function

2022-07-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Nice work! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130726/new/ https://reviews.llvm.org/D130726 ___ cfe-commits mailing list

[PATCH] D130726: [clang][dataflow] Handle multiple context-sensitive calls to the same function

2022-07-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:3963 +TEST(TransferTest, ContextSensitiveSetBothTrueAndFalse) { + std::string Code = R"( samestep wrote: > ymandel wrote: > > Are there more scenarios testable

[PATCH] D130726: [clang][dataflow] Handle multiple context-sensitive calls to the same function

2022-07-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks great! Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:227 + +const VarDecl *Param = *ParamIt; +auto = Env.createStorageLocation(*Param); maybe mention in the patch description that it also improves

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D130306#3681291 , @samestep wrote: > In D130306#3680942 , @chapuni wrote: > >> A few variables cause warinings in -Asserts. > > Thanks for pointing this out! How should I address this?

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h:64 TypeErasedDataflowAnalysis(bool ApplyBuiltinTransfer) - : Options({ApplyBuiltinTransfer}) {} + :

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D130306#3676325 , @samestep wrote: > >> The main reason I wanted to call this out because it increasingly seems to >> be whenever a decision needs to be made, the framework is getting less and >> less sound. Basically,

[PATCH] D130398: [clang][dataflow] Add Environment::dump()

2022-07-22 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/DebugSupport.cpp:117-120 +for (const std::string : ConstraintsStrings) { + Result += S; + Result += '\n'; +

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:220 + assert(Body != nullptr); + initGlobalVars(*Body, Env); + samestep wrote: > ymandel wrote: > > samestep wrote: > > > ymandel wrote: > > > > I wonder how

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:208 + + // TODO: Currently this only works if the callee is never a method and the + // same callee is never analyzed from multiple separate callsites. To

[PATCH] D130270: [clang][dataflow] Use a dedicated bool to encode which branch was taken

2022-07-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/DataflowAnalysisContextTest.cpp:439 Context.addFlowConditionConstraint(FC2, Y); - // JoinedFC = (FC1 || FC2) && Z = (X || Y) && Z - auto = Context.joinFlowConditions(FC1, FC2); + //

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Sam, this is a great start! I'm really excited to see that you have a core working so quickly. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:208 + + // TODO: Currently this only works if the callee is never a method and the +

[PATCH] D128807: [clang][transformer] Finish plumbing `Note` all the way to the output.

2022-07-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. > For my particular case, I just need multiple notes per rule. I don't need > them to be associated to a particular edit (and in that very particular case, > I don't even need a source location). I'm not sure I understand: you need this additional note, but it doesn't

[PATCH] D128807: [clang][transformer] Finish plumbing `Note` all the way to the output.

2022-06-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D128807#3622727 , @li.zhe.hua wrote: > - A note being a part of an edit seems weird at best. An `ASTEdit` and `Edit` > are fragments of a greater, logical change. That a note should semantically > be associated with the

[PATCH] D128924: [clang][dataflow] Replace TEST_F with TEST where possible

2022-06-30 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128924/new/ https://reviews.llvm.org/D128924

[PATCH] D128774: [libTooling] Add a comment about comment parsing to getAssociatedRange.

2022-06-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG007934343c4c: [libTooling][NFC] Add a comment about comment parsing to getAssociatedRange. (authored by jacobsa, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D128774: [libTooling] Add a comment about comment parsing to getAssociatedRange.

2022-06-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. sure Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128774/new/ https://reviews.llvm.org/D128774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D128807: [clang][transformer] Finish plumbing `Note` all the way to the output.

2022-06-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Overall, looks good. But my main question is whether this functionality should be supported in the Edit's Metadata field instead. Eric -- what do you think? You've thought a lot more about metadata recently. Comment at:

[PATCH] D128848: Fix assertion when analyzing a for-loop with no condition expression

2022-06-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks like you and Stanislav had the same idea? https://reviews.llvm.org/D128833 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128848/new/ https://reviews.llvm.org/D128848 ___

[PATCH] D128774: [libTooling] Add a comment about comment parsing to getAssociatedRange.

2022-06-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Transformer/SourceCode.h:47 +/// range containing associated comments, you may need to invoke the tool with +/// -fparse-all-comments. CharSourceRange getAssociatedRange(const Decl , ASTContext );

[PATCH] D128774: [libTooling] Add a comment about comment parsing to getAssociatedRange.

2022-06-29 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. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128774/new/ https://reviews.llvm.org/D128774

[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

2022-06-28 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/D128352/new/ https://reviews.llvm.org/D128352

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h:126 +std::function +PostVisitStmt = nullptr); Please update comment to mention this new param (and that its optional)

[PATCH] D128446: [clang][dataflow] Use annotations for optional diagnostic tests

2022-06-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. This looks quite nice. I really like how you solved the problem of diagnostics representation/checking. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128446/new/ https://reviews.llvm.org/D128446

[PATCH] D126973: [clang][dataflow] Relax assumption that `AggregateStorageLocations` correspond to struct type.

2022-06-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel abandoned this revision. ymandel added a comment. In D126973#3592537 , @xazax.hun wrote: > With properties moved up in the hierarchy this could be abandoned now, right? Yes, I think that would be best. Thanks for the reminder! Repository: rG

[PATCH] D128060: [clang][dataflow] Extend flow condition in the body of a for loop

2022-06-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Mild preference for splitting into three tests, since it technically different code that's covered in each. But, up to you. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128060/new/

[PATCH] D128013: [clang][dataflow] Add support for comma binary operator

2022-06-17 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128013/new/ https://reviews.llvm.org/D128013

[PATCH] D127898: [clang][dataflow] Find unsafe locs after fixpoint

2022-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:35 +using NoopDiags = std::tuple<>; + I'm not sure that this is valid style. It's essentially a unit type, which I quite like, but I've never seen this

[PATCH] D127865: [clang][dataflow] Make `Value` and `StorageLocation` non-copyable

2022-06-15 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127865/new/ https://reviews.llvm.org/D127865

[PATCH] D127746: [clang][dataflow] Convert `PointeeLoc` of `PointerValue` from reference to pointer.

2022-06-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Herald added a subscriber: martong. Overall, this seems to be an important API change, and I'm having trouble seeing the big picture here. I think it would be great if you could expand (in the CL description) on the motivation behind the change and the thinking behind

[PATCH] D125931: [clang][dataflow] Add support for correlated branches to optional model

2022-06-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:174 +/// property of the optional value `OptionalVal`. +void setHasValue(StructValue , BoolValue ) { + OptionalVal.setProperty("has_value", HasValueVal);

[PATCH] D125931: [clang][dataflow] Add support for correlated branches to optional model

2022-06-13 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. I love the tests (pretty cool examples of what can be handled). Thanks for the thoroughness! Comment at:

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

2022-06-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Ping... Gabor, Stanislav: what are your thoughts on this patch? I think we're in a place where I could do performance comparisons before/after if you think that's justified. Alternatively, I have a relatively simple proposal

[PATCH] D127502: [clang][dataflow] Don't `assert` full LHS coverage in `optional` model

2022-06-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa9ad689e352d: [clang][dataflow] Dont `assert` full LHS coverage in `optional` model (authored by samestep, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D127502: [clang][dataflow] Don't `assert` full LHS coverage in `optional` model

2022-06-10 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. Do I understand correctly that the test you added in D127434 covers this change as well? (in that this change moves it from crashing to not crashing)

[PATCH] D127434: [clang][dataflow] In `optional` model, match call return via hasType

2022-06-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 rGcd0d52610d80: [clang][dataflow] In `optional` model, match call return via hasType (authored by samestep, committed by ymandel). Repository: rG

[PATCH] D127434: [clang][dataflow] In `optional` model, match call return via hasType

2022-06-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Is there a test you can add that would cover this change? Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:170 + // multiple overloads of `hasType` match. + ast_matchers::internal::Matcher typeMatcher = anyOf( +

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

2022-06-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 rGdd38caf3b5b7: [clang][dataflow] Track `optional` contents in `optional` model. (authored by ymandel). Repository: rG LLVM Github Monorepo

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

2022-06-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 435537. ymandel added a comment. add missing blank line to test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124932/new/ https://reviews.llvm.org/D124932 Files:

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

2022-06-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 435528. ymandel added a comment. rebase and merge Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124932/new/ https://reviews.llvm.org/D124932 Files:

[PATCH] D126888: Add a parameter to LoadFromASTFile that accepts a file system and defaults to the real file-system.

2022-06-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9d6d069f4e9a: Add a parameter to LoadFromASTFile that accepts a file system and defaults to… (authored by asoffer, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D127008: [clang][dataflow] Fix filename typos in tests

2022-06-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdcb4950d5b5b: [clang][dataflow][NFC] Fix filename typos in tests (authored by samestep, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D127196: [clang][dataflow] Enable use of synthetic properties on all Value instances.

2022-06-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127196/new/ https://reviews.llvm.org/D127196 ___ cfe-commits mailing list

[PATCH] D126973: [clang][dataflow] Relax assumption that `AggregateStorageLocations` correspond to struct type.

2022-06-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D126973#3558304 , @gribozavr2 wrote: >> using the StructValue for its properties, while modeling a non-struct type. > > Could you explain the use case in more details? A `StructValue` is used to model a complex underlying

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