[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 wi

[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] 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] 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] 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] 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 &D, ASTContext &Context); -

[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 ___ cf

[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: clang/lib/Tooling/Transformer/R

[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 https://lists.llvm.org/cgi

[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 h

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

[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 n

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

2022-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 418206. ymandel added a comment. remove stray comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122231/new/ https://reviews.llvm.org/D122231 Files: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptio

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

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

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

2022-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 6 inline comments as done and an inline comment as not done. ymandel added a comment. Thanks for the detailed review! Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:119 + auto NonEmptyStringOptional = unaryOperator( +

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

2022-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 418209. ymandel marked an inline comment as done. ymandel added a comment. adjust logical formula Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122231/new/ https://reviews.llvm.org/D122231 Files: clang/lib/A

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

2022-03-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 3 inline comments as done. Closed by commit rGa184a0d8aae6: [clang][dataflow] Add support for disabling warnings on smart pointers. (authored by ymandel)

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

2022-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:270 + // needed. + BoolValue &ComparisonValue = MakeValue(Env, *HasValueVal); + auto *ComparisonExprLoc =

[PATCH] D122499: [libTooling] Support TransformerResult in consumer callbacks

2022-03-25 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/Tooling/Transformer/Transformer.h:126-128 +template +std::enable_if_t::value, void> +assertMetadataSet(const transformer::RewriteRuleWi

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

2022-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:270 + // needed. + BoolValue &ComparisonValue = MakeValue(Env, *HasValueVal); + auto *ComparisonExprLoc = xazax.hun wrote: > xazax.hun wrote: >

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

2022-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:270 + // needed. + BoolValue &ComparisonValue = MakeValue(Env, *HasValueVal); + auto *ComparisonExprLoc = ymandel wrote: > xazax.hun wrote: > >

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

2022-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:279 + cast_or_null(Env.getValue(*ComparisonExprLoc))) { +Env.setValue(*ComparisonExprLoc, + Env.makeAnd(*CurrentValue, Comparis

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

2022-03-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:270 + // needed. + BoolValue &ComparisonValue = MakeValue(Env, *HasValueVal); + auto *ComparisonExprLoc =

[PATCH] D122499: [libTooling] Support TransformerResult in consumer callbacks

2022-03-28 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 rGe334f044cdb5: [libTooling] Support TransformerResult in consumer callbacks (authored by li.zhe.hua, committed by ymandel). Repository: rG L

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

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

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

2022-03-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 7 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:142 + // `opt.value_or(nullptr) != nullptr` and `opt.value_or(0) != 0`. Ideally, + // we'd support this pattern for any

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

2022-03-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added a comment. In D122231#3414109 , @xazax.hun wrote: > Wow. This did take some iterations and I feel like I just added to the > confusion at some point :D But the latest iteration looks much simpler an

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

2022-03-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 419240. ymandel marked 5 inline comments as done. ymandel added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122231/new/ https://reviews.llvm.org/D122231 Files: clang/lib/Analys

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

2022-03-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 419243. ymandel added a comment. delete line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122231/new/ https://reviews.llvm.org/D122231 Files: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessM

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

2022-03-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:275 + State.Env.getValue(*ValueOrPredExpr, SkipPast::None)); + if (ExprValue == nullptr) { +auto &ExprLoc = State.Env.createStorageLocation(*ValueOrPredE

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

2022-03-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7f076004e941: [clang][dataflow] Add support for `value_or` in a comparison. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122231/new/

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

2022-03-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: sgatev, gribozavr2. Herald added subscribers: tschuett, steakhal. Herald added a project: All. ymandel updated this revision to Diff 417906. ymandel added a comment. ymandel updated this revision to Diff 419430. ymandel retitled this revision

[PATCH] D122830: [clang][dataflow] Add support for (built-in) (in)equality operators

2022-03-31 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. Adds logical interpretation of built-in equality operators, `==`

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

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

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

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

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

2022-03-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the reviews. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:185 + // base classes, because they are not visible in derived classes. + getFieldsFromClassHierarchy(Base.getType(), /*IgnorePrivateFields=*/true, +

[PATCH] D122830: [clang][dataflow] Add support for (built-in) (in)equality operators

2022-03-31 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/Transfer.cpp:56 +Env.getValue(*RHSNorm, SkipPast::Reference))) + return Env.makeIff(*LHSValue, *RHSValue); + xazax.hun wrote: >

[PATCH] D122838: [clang][dataflow] Add support for correlation of boolean (tracked) values

2022-03-31 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 extends the join logic for environments to explicitly

[PATCH] D122838: [clang][dataflow] Add support for correlation of boolean (tracked) values

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:79 +for (BoolValue *Constraint : Env1.getFlowConditionConstraints()) { + Expr1 = &Env1.makeAnd(*Expr1, *Constraint); +} sgatev wrote: > xazax.hun wrot

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

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

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 419744. ymandel marked 5 inline comments as done. ymandel added a comment. add clarifying comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122273/new/ https://reviews.llvm.org/D122273 Files: clang/inclu

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/StorageLocation.h:59-60 /// can be traced independently by abstract interpretation. For example: a -/// struct with public members. +/// struct with public members. Note that the corresponding

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 419751. ymandel added a comment. tweak comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122273/new/ https://reviews.llvm.org/D122273 Files: clang/include/clang/Analysis/FlowSensitive/StorageLocation.h

[PATCH] D122273: [clang][dataflow] Fix handling of base-class fields

2022-04-01 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 rG36d4e84427a7: [clang][dataflow] Fix handling of base-class fields. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D122908: [clang][dataflow] Add support for clang's `__builtin_expect`.

2022-04-01 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 basic modeling of `__builtin_expect`, just to pr

[PATCH] D122838: [clang][dataflow] Add support for correlation of boolean (tracked) values

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 419764. ymandel added a comment. Add comment about future optimization potential. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122838/new/ https://reviews.llvm.org/D122838 Files: clang/include/clang/Analysi

[PATCH] D122838: [clang][dataflow] Add support for correlation of boolean (tracked) values

2022-04-01 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:79 +for (BoolValue *Constraint : Env1.getFlowConditionConstraints()) { + Expr1 = &Env1.makeAnd(*Expr1, *Constraint); +} -

[PATCH] D122830: [clang][dataflow] Add support for (built-in) (in)equality operators

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

[PATCH] D122830: [clang][dataflow] Add support for (built-in) (in)equality operators

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:53 + if (auto *LHSValue = dyn_cast_or_null( + Env.getValue(*LHSNorm, SkipPast::Reference))) +if (auto *RHSValue = dyn_cast_or_null( ---

[PATCH] D122830: [clang][dataflow] Add support for (built-in) (in)equality operators

2022-04-01 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 rGef1e1b3106a5: [clang][dataflow] Add support for (built-in) (in)equality operators (authored by ymandel). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D122838: [clang][dataflow] Add support for correlation of boolean (tracked) values

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ymandel marked an inline comment as done. Closed by commit rG01db10365e93: [clang][dataflow] Add support for correlation of boolean (tracked) values (authored by ymandel). Changed prior to commit: https://reviews.llvm.org

[PATCH] D122908: [clang][dataflow] Add support for clang's `__builtin_expect`.

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 419802. ymandel added a comment. add tests for other builtins. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122908/new/ https://reviews.llvm.org/D122908 Files: clang/lib/Analysis/FlowSensitive/Transfer.cpp

[PATCH] D122908: [clang][dataflow] Add support for clang's `__builtin_expect`.

2022-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 419804. ymandel added a comment. comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122908/new/ https://reviews.llvm.org/D122908 Files: clang/lib/Analysis/FlowSensitive/Transfer.cpp clang/unittests/Anal

[PATCH] D122908: [clang][dataflow] Add support for clang's `__builtin_expect`.

2022-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG506ec85ba82a: [clang][dataflow] Add support for clang's `__builtin_expect`. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122908/new/

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

2022-04-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. Google's protobufs are often quite large and their internal stat

[PATCH] D123037: [clang][dataflow] Support integral casts

2022-04-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. Adds support for implicit casts `CK_IntegralCast` and `CK_Integr

[PATCH] D123037: [clang][dataflow] Support integral casts

2022-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 420196. ymandel added a comment. fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123037/new/ https://reviews.llvm.org/D123037 Files: clang/lib/Analysis/FlowSensitive/Transfer.cpp clang/unittests/Ana

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

2022-04-05 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:513 + const RecordDecl *RD = BaseTy->getDecl(); + if (RD->getIdentifier() == nullptr || RD->getName() != "Message") +return false; -

[PATCH] D123037: [clang][dataflow] Support integral casts

2022-04-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 420483. 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/D123037/new/ https://reviews.llvm.org/D123037 Files: clang/lib/Analysi

[PATCH] D123037: [clang][dataflow] Support integral casts

2022-04-05 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/TransferTest.cpp:1904 -const auto *FooVal = -cast(Env.getValue(*FooDecl, SkipPast::None)); -const auto *

[PATCH] D123037: [clang][dataflow] Support integral casts

2022-04-05 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 rGd002495b949c: [clang][dataflow] Support integral casts (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[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}) {} + : Options({ApplyBuilt

[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] 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 &Loc = Env.createStorageLocation(*Param); maybe mention in the patch description that it also improv

[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 a

[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 cfe-commits@lis

[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 mod

[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 cfe-commits@lists.

[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 non

[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: clang/include/c

[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: clang/

[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: clang/include/clang/Analys

[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 cl

[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 build(cons

[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 c

[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 = null

[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 li

[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] 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] 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 cfe-commits@lists.l

[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 wrote:

[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 `Co

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

[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: clang/include/clang/Analysis/FlowSensitive/Contro

[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 so

[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. +assert(false

[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] 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: clang/include

[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: clang/include/clang/Analy

[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 not

[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 thei

[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] 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] 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] 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] D106011: [clang-tidy] performance-unnecessary-copy-initialization: Disable check when variable and initializer have different replaced template param types.

2021-07-16 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-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:178-183 + if (VarTmplType->getReplacedParameter()->desugar().getCanonical

[PATCH] D106173: [clang-tidy] performance-unnecessary-copy-initialization: Create option to exclude container types from triggering the check.

2021-07-16 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. I was only a little confused by the first sentence of the option description. Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-unnecessary-cop

[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/include/clang/Analysis/FlowSensitive/MatchSwitch.h:42 - /// Current lattice element. + ASTContext &ASTCtx; LatticeT &Lattice; This shouldn't be needed, since we now pass the `MatchFinder::MatchResult` in `A

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