[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-09-05 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu added a comment. Thanks, addressed the comments, PTAL~ Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:688-690 + for ([[maybe_unused]] auto [Field, Loc] : FieldLocs) { +assert(ModeledFields.contains(cast_or_null(Field))); + } mb

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-09-05 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 555842. kinu marked 5 inline comments as done. kinu added a comment. Updated again... very easy to overlook unaddressed comments! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159284/new/ https://reviews.llvm.org/

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-09-05 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 555840. kinu marked 2 inline comments as done. kinu added a comment. More fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159284/new/ https://reviews.llvm.org/D159284 Files: clang/lib/Analysis/FlowSensitive

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-09-05 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 555838. kinu marked an inline comment as done and an inline comment as not done. kinu added a comment. Updated Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159284/new/ https://reviews.llvm.org/D159284 Files: c

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-09-04 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu added a comment. Thanks! Updated the patch. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:650 + assert(FieldsForInit.size() + R->getNumBases() == Inits.size()); + for ([[maybe_unused]] const CXXBaseSpecifier &Base : R->bases()) { +assert(Init

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-09-04 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 555777. kinu marked 19 inline comments as done. kinu added a comment. Addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159284/new/ https://reviews.llvm.org/D159284 Files: clang/lib/Analysis/Flow

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-09-04 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 555676. kinu added a comment. reverted wrong changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159284/new/ https://reviews.llvm.org/D159284 Files: clang/lib/Analysis/FlowSensitive/Transfer.cpp clang/unitt

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-08-31 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 555166. kinu added a comment. Exclude lambdas Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159284/new/ https://reviews.llvm.org/D159284 Files: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp clang/l

[PATCH] D159284: [clang][dataflow] Fix Record initialization with InitListExpr and inheritances

2023-08-31 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:131 +// initialized with InitListExpr. assert(&RecordVal1->getLoc() == &RecordVal2->getLoc()); Note, this hits regardless of my change, but not very often.

[PATCH] D159284: Fix Record initialization with InitListExpr and inheritances

2023-08-31 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu created this revision. Herald added a reviewer: NoQ. Herald added a project: All. kinu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Usually RecordValues for record objects (e.g. struct) are initialized with `Environment::createValue

[PATCH] D159248: Fix crash when struct with inheritance is initialized with InitExpr

2023-08-30 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 554906. kinu added a comment. updated comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159248/new/ https://reviews.llvm.org/D159248 Files: clang/include/clang/Analysis/FlowSensitive/StorageLocation.h cla

[PATCH] D159248: Fix crash when struct with inheritance is initialized with InitExpr

2023-08-30 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu created this revision. Herald added a reviewer: NoQ. Herald added a project: All. kinu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This fix still leaves inherited fields from base classes unpopulated (even if they are accessed in t

[PATCH] D159235: Fix crash when struct with inheritance is initialized with InitExpr

2023-08-30 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 554868. kinu added a comment. Add assignment test cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159235/new/ https://reviews.llvm.org/D159235 Files: clang/include/clang/Analysis/FlowSensitive/StorageLocati

[PATCH] D159235: Fix crash when struct with inheritance is initialized with InitExpr

2023-08-30 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu created this revision. Herald added a reviewer: NoQ. Herald added a project: All. kinu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This fix doesn't fix the problem of non-populated fields in base classes (even if they are accessed

[PATCH] D152732: [clang][dataflow] Support limits on the SAT solver to force timeouts.

2023-06-12 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu added a comment. LGTM as well, I was initially thinking about having a local limit per query (which could be easier to pinpoint the particular query that explodes), but per-solver instance limit could make sense as a starter too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-03 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu marked an inline comment as done. kinu added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:2690 +// `after_loop` is pruned by PruneTriviallyFalseEdges, so we only should +// have `in_loop`. +ASSERT_TRUE(Results.

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-03 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 519029. kinu added a comment. Updated the stale comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149640/new/ https://reviews.llvm.org/D149640 Files: clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 518762. kinu added a comment. Updated changes further not to lose the existing checks with the do-while test. Also restored the simplest test that exercises the while-true one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu added a comment. (comment only) Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:2673 - -EXPECT_EQ(BarVal, FooPointeeVal); }); mboehme wrote: > It's unfortuante that all of these checks have gone away. I think the test >

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 518702. kinu added a comment. Changing the existing test to reflect the flag change Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149640/new/ https://reviews.llvm.org/D149640 Files: clang/lib/Analysis/FlowSensi

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu added a comment. In D149640#4311889 , @gribozavr2 wrote: > Is it testable? For example, can we show that we don't compute the program > state for the program point "p" here: I added a simple test, how does it look? Repository: rG LLVM Github M

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu updated this revision to Diff 518676. kinu added a comment. Add a while-true test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149640/new/ https://reviews.llvm.org/D149640 Files: clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp cl

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Kinuko Yasuda via Phabricator via cfe-commits
kinu created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. kinu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. It looks like keeping this false could end up with ext