[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 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] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-26 Thread NAKAMURA Takumi via Phabricator via cfe-commits
chapuni added a comment. A few variables cause warinings in -Asserts. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:216 + assert(FuncDecl != nullptr); + const auto *Body = FuncDecl->getBody(); + assert(Body != nullptr); It is used only

[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] 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 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 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 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-26 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. Herald added a subscriber: rnkovacs. In D130306#3679294 , @samestep wrote: > @xazax.hun Do you have anything else you'd like addressed/changed (e

[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] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-25 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130306#3676672 , @xazax.hun wrote: > Thanks! Knowing the context, I am much happier with the direction overall. Is > the plan to analyze a mock of std::optional instead of the actual code in the > STL? How will that mock be

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

2022-07-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thanks! Knowing the context, I am much happier with the direction overall. Is the plan to analyze a mock of std::optional instead of the actual code in the STL? How will that mock be shipped? Would that be embedded in the binary? In D130306#3676475

[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, ma

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

2022-07-25 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130306#3673120 , @xazax.hun wrote: > Thanks! I think this is a major design decision, and I'd love to see a > discussion about the alternatives considered before jumping to an > implementation. Specifically, I'd like to kno

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

2022-07-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D130306#3671852 , @samestep wrote: > In D130306#3670259 , @xazax.hun > wrote: > >> > > Yes, we considered a summary-based approach, but we decided not to use it > because (as you m

[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 446958. samestep added a comment. Appease -Wmissing-field-initializers 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/FlowSens

[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/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h:64 TypeErasedDataflowAnalysis(bool ApplyBuiltinTransfer) : Options({ApplyBuiltinTransfer}) {} li.zhe.hua wrote: > Nit: `-Wmissing-fiel

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

2022-07-22 Thread Eric Li via Phabricator via cfe-commits
li.zhe.hua added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h:64 TypeErasedDataflowAnalysis(bool ApplyBuiltinTransfer) : Options({ApplyBuiltinTransfer}) {} Nit: `-Wmissing-field-initializers` is

[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 446915. samestep added a comment. Update comment about default parameters 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/FlowS

[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:220 + assert(Body != nullptr); + initGlobalVars(*Body, Env); + ymandel wrote: > samestep wrote: > > ymandel wrote: > > > samestep wrote: > > > > ymandel wrote:

[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 446914. samestep added a comment. Don't allow globals 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] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:231 + // parameters still need to be given `StorageLocation`s anyway, so this code + // will need to be generalized later. + for (; ArgIt != ArgEnd; ++ParamIt, ++ArgIt) { ---

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

[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 446855. samestep added a comment. Fix typo in comment 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] 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:220 + assert(Body != nullptr); + initGlobalVars(*Body, Env); + ymandel wrote: > samestep wrote: > > ymandel wrote: > > > I wonder how this will work between cal

[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 446842. samestep added a comment. Address Yitzie's comments 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/Dataf

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

[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] 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 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] 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] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. 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 taking. While this approach is relatively easy to implement and has great precision, it

[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