[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-22 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked 3 inline comments as done. sgatev added a comment. I also agree that the current approach isn't robust. I think that a proper solution would involve patching the CFG because in some cases it seems to be incorrect. For example, the call to `qux` is incorrectly deemed to be unreacha

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-22 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 395841. sgatev marked 2 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116022/new/ https://reviews.llvm.org/D116022 Files: clang/in

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In D116022#3205478 , @gribozavr2 wrote: >> How resilient is this pattern matching? > > Possibly it is not very robust. However it is very important for a certain > style of precondition verification macros used by various Goog

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. > How resilient is this pattern matching? Possibly it is not very robust. However it is very important for a certain style of precondition verification macros used by various Google projects. I can't find an exact open source copy, but they are generally similar to t

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:50 + std::unique_ptr Cfg; + llvm::DenseMap StmtToBlock; +}; xazax.hun wrote: > There is a special class for this at `clang/lib/Analysis/CFGStmtMap.cpp`

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I am looking at the CFG and wonder if this change is what we what to do in the first place: [B7 (ENTRY)] Succs (1): B6 [B1] 1: 0 2: (void)[B1.1] (CStyleCastExpr, ToVoid, void) Preds (2): B2(Unreachable) B3 Succs (1): B0 [B2 (NORET

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:50 + std::unique_ptr Cfg; + llvm::DenseMap StmtToBlock; +}; There is a special class for this at `clang/lib/Analysis/CFGStmtMap.cpp`. That also does so

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 395393. sgatev added a comment. Remove anonymous namespace. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116022/new/ https://reviews.llvm.org/D116022 Files: clang/include/clang/Analysis/FlowSensitive/Control

[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

2021-12-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: rnkovacs, mgorny. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A dataflow an