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

2022-09-09 Thread Sam Estep via Phabricator via cfe-commits
samestep accepted this revision. samestep added a comment. @ymandel Huh, interesting! I'll go ahead and abandon this patch, then? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130270/new/ https://reviews.llvm.org/D130270 __

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

2022-06-27 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 440211. samestep added a comment. - Merge branch 'main' into diagnose-api Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/include/clang/Analysis/Flow

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

2022-06-27 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 440406. samestep added a comment. - Bring back Diagnosis.h Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/docs/tools/clang-formatted-files.txt clan

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

2022-06-28 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 440687. samestep added a comment. - Implement Gábor's suggestion - Merge branch 'main' into diagnose-api Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: cl

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

2022-06-28 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 440702. samestep added a comment. Herald added a project: clang. - Merge branch 'diagnose-api' into optional-check-diagnose - Use the updated API Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128352/new/ https

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

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep marked 9 inline comments as done. samestep added a comment. Fixed all the minor nits and responded to some comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:401 + const TypeErasedDataflowAnalysisState &State

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

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 441084. samestep added a comment. - Merge branch 'main' into diagnose-api - Fix minor nits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/include/cl

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

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 441112. samestep added a comment. - Tidy AnalysisData struct and PostVisitStmt param Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/include/clang/An

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

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep marked an inline comment as done. samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:126-129 +auto *Lattice = +llvm::any_cast(&State.Lattice.Value); +PostVisitStmt(Stmt, DataflowAnalysisS

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

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 441117. samestep added a comment. - Merge branch 'diagnose-api' into optional-check-diagnose - Update using review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128352/new/ https://reviews.llvm.org/D1

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 441118. samestep added a comment. - Merge branch 'optional-check-diagnose' into optional-model-noop-lattice Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128356/new/ https://reviews.llvm.org/D128356 Files:

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

2022-06-29 Thread Sam Estep 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 rG58fe7f9683a0: [clang][dataflow] Add API to separate analysis from diagnosis (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES S

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

2022-06-29 Thread Sam Estep 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 rGcafb8b4ff2c3: [clang][dataflow] Use diagnosis API in optional checker (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-29 Thread Sam Estep 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 rG335c05f5d19f: [clang][dataflow] Use NoopLattice in optional model (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D128851: [clang][dataflow] Use NoopLattice in optional model

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, carlosgalvezp, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added projects: clang, clang-tools-extra. Herald added a subscriber: cfe-commits. Reland of D128356

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 441142. samestep added a comment. Herald added a subscriber: carlosgalvezp. Herald added a project: clang-tools-extra. Update UncheckedOptionalAccessCheck.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12835

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-29 Thread Sam Estep 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 rGcf1f978d319b: [clang][dataflow] Use NoopLattice in optional model (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D128448: [clang][dataflow] Delete SourceLocationsLattice

2022-06-29 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 441144. samestep added a comment. Update from main Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128448/new/ https://reviews.llvm.org/D128448 Files: clang/docs/tools/clang-formatted-files.txt clang/includ

[PATCH] D128448: [clang][dataflow] Delete SourceLocationsLattice

2022-06-29 Thread Sam Estep 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 rG6a97be27a1de: [clang][dataflow] Delete SourceLocationsLattice (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

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

2022-06-30 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D1

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

2022-06-30 Thread Sam Estep 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 rG1d83a16bd3fa: [clang][dataflow] Replace TEST_F with TEST where possible (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. @xazax.hun Do you have anything else you'd like addressed/changed (either here or in the doc we shared with you) before I land this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D1303

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 447656. samestep added a comment. Rebase and add Yitzie's assertion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130270/new/ https://reviews.llvm.org/D130270 Files: clang/include/clang/Analysis/FlowSensiti

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130270#3679273 , @gribozavr2 wrote: > Sorry, could you rebase the patch? It does not apply cleanly anymore. Done; I didn't see any conflicts when I rebased, but hopefully the issue on your end is resolved now? Repository

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 447750. samestep added a comment. Be explicit when constructing TransferOptions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis

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

2022-07-26 Thread Sam Estep 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 rGfa2b83d07eca: [clang][dataflow] Analyze calls to in-TU functions (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 447758. samestep added a comment. Use different name for TransferOptions field Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis/

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

2022-07-26 Thread Sam Estep 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 rG300fbf56f89a: [clang][dataflow] Analyze calls to in-TU functions (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D130593: [clang][dataflow] Separate context by frame

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorep

[PATCH] D130593: [clang][dataflow] Separate context by frame

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 447808. samestep added a comment. Use operator[] instead of try_emplace for C++14 compatibility Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130593/new/ https://reviews.llvm.org/D130593 Files: clang/includ

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D130593

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130306#3680942 , @chapuni wrote: > A few variables cause warinings in -Asserts. Thanks for pointing this out! How should I address this? Should I just inline the definitions of those variables into the `assert`s themselves?

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 447906. samestep added a comment. Address Dmitri's review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/Analysis/FlowSensitive/Dataflo

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

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:110 + /// Assigns `Loc` as the storage location of `return`. + /// gribozavr2 wrote: > Done. Comment at: clang/include/clang

[PATCH] D130593: [clang][dataflow] Separate context by frame

2022-07-26 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130593#3681126 , @xazax.hun wrote: > While separate call strings are properly isolated from each other, repeated > analysis of the same call is not:| > > while (...) > { > foo(...); > } > > In the above code snippe

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

2022-07-27 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:338-339 +if (Loc == nullptr) { + // The outermost context does not set a storage location for `return`, so + // in that case we just ignore `return` statements. + return;

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

2022-07-27 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 448026. samestep added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130270/new/ https://reviews.llvm.org/D130270 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.

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

2022-07-27 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. @gribozavr2 I rebased again, should work now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130270/new/ https://reviews.llvm.org/D130270 ___ cfe-commits mailing list cfe-commits

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

2022-07-27 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 448044. samestep added a comment. Set a storage location for the outermost context too Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/A

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

2022-07-27 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:114 + /// + /// `return` must not be assigned a storage location. + void setReturnStorageLocation(StorageLocation &Loc) { li.zhe.hua wrote: > Fix

[PATCH] D130593: [clang][dataflow] Separate context by frame

2022-07-27 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. Note: after some discussion with @ymandel, we've decided to adjust our design for this. A new patch is on the way which will replace this one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130593/new/ https://reviews.llvm

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

2022-07-28 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:114 + /// + /// `return` must not be assigned a storage location. + void setReturnStorageLocation(StorageLocation &Loc) { sgatev wrote: > li.zhe.

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

2022-07-28 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 448405. samestep added a comment. Add FIXME about passing `TookSecondBranch` to `merge` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130270/new/ https://reviews.llvm.org/D130270 Files: clang/include/clang/

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

2022-07-28 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:103 if (Value *MergedVal = MergedEnv.createValue(Type)) if (Model.merge(Type, *Val1, Env1, *Val2, Env2, *MergedVal, MergedEnv)) return MergedVal; s

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

2022-07-28 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorep

[PATCH] D130593: [clang][dataflow] Separate context by frame

2022-07-28 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. Here is the new patch: D130726 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130593/new/ https://reviews.llvm.org/D130593 ___ cfe-commits mail

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

2022-07-28 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:227 + +const VarDecl *Param = *ParamIt; +auto &Loc = Env.createStorageLocation(*Param); ymandel wrote: > maybe mention in the patch description that it al

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

2022-07-28 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 448438. samestep added a comment. Address some of Yitzie's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130726/new/ https://reviews.llvm.org/D130726 Files: clang/include/clang/Analysis/FlowSensiti

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

2022-07-29 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:3963 +TEST(TransferTest, ContextSensitiveSetBothTrueAndFalse) { + std::string Code = R"( ymandel wrote: > ymandel wrote: > > samestep wrote: > > > ymandel wrote

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

2022-07-29 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 448698. samestep added a comment. Add more comments and tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130726/new/ https://reviews.llvm.org/D130726 Files: clang/include/clang/Analysis/FlowSensitive/Dat

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

2022-07-29 Thread Sam Estep 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 rGa6ddc6848782: [clang][dataflow] Handle multiple context-sensitive calls to the same function (authored by samestep). Changed prior to commit: http

[PATCH] D131014: [clang][dataflow] Make the type of the post visit callback consistent

2022-08-02 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. Seems reasonable 👍 I'm curious though, why does this not require `clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp` to be updated? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131014/new/ https://r

[PATCH] D131065: [clang][dataflow] Store DeclContext of block being analysed in Environment if available.

2022-08-03 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:216 const auto *FuncDecl = Call->getDirectCallee(); assert(FuncDecl != nullptr); I think you need to set the `DeclCtx` field here (or at least, somewhere

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

2022-08-03 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. Looks awesome, thanks @ymandel! Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:23 #include "clang/AST/Stmt.h" -#include "clang/Analysis/CFG.h" #include "clang/Analysis/FlowSensitive/ControlFlowContext.h" I'

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

2022-08-03 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 449667. samestep added a comment. Rebase and address all comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/Analysis/FlowSensitive

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

2022-08-03 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 449752. samestep added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:345 +// FIXME: Support reference-type returns. +assert(Val->getKind() != Value::Kind::Reference); + sgatev wrote: > Let's do `if (Val->getKind() == Value::Kind::Refe

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:348 +auto *Loc = Env.getReturnStorageLocation(); +assert(Loc != nullptr); +// FIXME: Model NRVO. sgatev wrote: > samestep wrote: > > sgatev wrote: > > > Let's do

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 449958. samestep added a comment. Don't assert returns to not be references Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/Analysis/Flo

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 449975. samestep added a comment. Use CallExpr location for ReturnLoc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/Analysis/FlowSensi

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 449976. samestep added a comment. Revert an unnecessary little change Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/Analysis/FlowSensi

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https:/

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:383 StorageLocation *ReturnLoc = nullptr; - // FIXME: Move `ThisPointeeLoc` here from `DataflowAnalysisContext`. + StorageLocation *ThisPointeeLoc = nullptr; --

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 449986. samestep added a comment. Address Stanislav's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131170/new/ https://reviews.llvm.org/D131170 Files: clang/include/clang/Analysis/FlowSensitive/Da

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:217 +const Expr *Arg = MethodCall->getImplicitObjectArgument(); +Env.ThisPointeeLoc = Env.getStorageLocation(*Arg, SkipPast::Reference); + } sgatev wrote

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

2022-08-04 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 450058. samestep added a comment. Add Stanislav's suggested comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130600/new/ https://reviews.llvm.org/D130600 Files: clang/include/clang/Analysis/FlowSensit

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

2022-08-04 Thread Sam Estep 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 rG0eaecbbc2318: [clang][dataflow] Handle return statements (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2022-08-04 Thread Sam Estep 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 rG8611a77ee7ee: [clang][dataflow] Analyze method bodies (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

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

2022-08-08 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https:/

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

2022-08-08 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 450944. samestep added a comment. Tweaks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

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

2022-08-08 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 450951. samestep added a comment. Fix bug Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:138 /// + /// `Call` must be either a `CallExpr` or a `CXXConstructExpr`. + /// sgatev wrote: > How about we define overloads that take these types

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 451134. samestep added a comment. Address Yitzie's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Analysis/FlowSensitive/Dataf

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 451233. samestep added a comment. Narrow public signature of pushCall Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Analysis/FlowSensi

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:71-74 +/// Builds a map of top-level functions and methods of top-level classes sounds +/// in the given AST, mapping from fully qualified function name to the +/// `Contr

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:248-258 + for (unsigned ArgIndex = 0; ArgIndex < NumArgs; ++ParamIt, ++ArgIndex) { assert(ParamIt != FuncDecl->param_end()); -const Expr *Arg = *ArgIt; -auto *ArgL

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D131438#3710697 , @xazax.hun wrote: > I feel like this is a repeated pattern. The CSA solved a very similar issue > by introducing the CallEvent class hierarchy. I also remember seeing many > disparate code snippets littered

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 451259. samestep added a comment. Use ArrayRef Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironmen

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep 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 Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 451265. samestep added a comment. Pull type-specific logic into overloads Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Analysis/FlowS

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 451267. samestep added a comment. Remove Call parameter from pushCallInternal method Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Ana

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

2022-08-09 Thread Sam Estep via Phabricator via cfe-commits
samestep 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-10 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:379 + /// Shared implementation of `pushCall` overloads. + void pushCallInternal(const FunctionDecl *FuncDecl, +ArrayRef Args);

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

2022-08-10 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 451445. samestep added a comment. Address Stanislav's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131438/new/ https://reviews.llvm.org/D131438 Files: clang/include/clang/Analysis/FlowSensitive/Da

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

2022-08-10 Thread Sam Estep 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 rG000c8fef86ab: [clang][dataflow] Analyze constructor bodies (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D131600: [clang][dataflow] Don't crash when caller args are missing storage locations

2022-08-10 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https:/

[PATCH] D131600: [clang][dataflow] Don't crash when caller args are missing storage locations

2022-08-10 Thread Sam Estep 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 rG43b298ea1282: [clang][dataflow] Don't crash when caller args are missing storage locations (authored by samestep). Repository: rG LLVM Github Mono

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

2022-07-21 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is a continuation of https://re

[PATCH] D130304: [clang][dataflow] Move NoopAnalysis from unittests to include

2022-07-21 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorep

[PATCH] D130305: [clang][dataflow] Refactor ApplyBuiltinTransfer field out into DataflowAnalysisOptions struct

2022-07-21 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D130304

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

2022-07-21 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D130305

[PATCH] D130304: [clang][dataflow] Move NoopAnalysis from unittests to include

2022-07-22 Thread Sam Estep 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 rG32dcb759c300: [clang][dataflow] Move NoopAnalysis from unittests to include (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES S

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

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

[PATCH] D130305: [clang][dataflow] Refactor ApplyBuiltinTransfer field out into DataflowAnalysisOptions struct

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:66 explicit DataflowAnalysis(ASTContext &Context) : Context(Context) {} explicit DataflowAnalysis(ASTContext &Context, bool ApplyBuiltinTransfer) : TypeErasedDat

[PATCH] D130305: [clang][dataflow] Refactor ApplyBuiltinTransfer field out into DataflowAnalysisOptions struct

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446829. samestep added a comment. Give a default value to ApplyBuiltinTransfer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130305/new/ https://reviews.llvm.org/D130305 Files: clang/include/clang/Analysis/

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

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446830. samestep added a comment. Update parent patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnv

[PATCH] D130305: [clang][dataflow] Refactor ApplyBuiltinTransfer field out into DataflowAnalysisOptions struct

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:66 explicit DataflowAnalysis(ASTContext &Context) : Context(Context) {} explicit DataflowAnalysis(ASTContext &Context, bool ApplyBuiltinTransfer) : TypeErasedDat

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

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130306#3670259 , @xazax.hun wrote: > There are many ways to introduce context sensitivity into the framework, this > patch seems to take the "inline substitution" approach, the same approach the > Clang Static Analyzer is t

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

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep 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 ymand

[PATCH] D130305: [clang][dataflow] Refactor ApplyBuiltinTransfer field out into DataflowAnalysisOptions struct

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446841. samestep added a comment. Mark bool constructors as deprecated Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130305/new/ https://reviews.llvm.org/D130305 Files: clang/include/clang/Analysis/FlowSens

  1   2   >