[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb611376e7eb5: [clang][dataflow] Singleton pointer values for null pointers. (authored by wyt, committed by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440162. wyt marked 2 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128056/new/ https://reviews.llvm.org/D128056 Files: clang/include/clang/Analysis

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:240-241 + // Index used to avoid recreating pointer values for null pointers of the + // same canonical pointee type. + // -

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:252-255 + // FIXME: The pointer values are indexed by the pointee types which are + // required to initialize the `PointeeLoc` field in `PointerValue`. Consider + // cr

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439721. wyt marked 5 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128056/new/ https://reviews.llvm.org/D128056 Files: clang/include/clang/Analysis

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-23 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev accepted this revision. sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:164-166 + /// Returns a pointer value that represents a null pointer. Calls + /// with `PointeeType` that are canonically equivalent wi

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-22 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:69 +Res.first->second = +&takeOwnership(std::make_unique(PointeeLoc)); + } ---

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-22 Thread weiyi via Phabricator via cfe-commits
wyt marked an inline comment as done. wyt added a comment. @xazax.hun > Since you always want this function to create a null pointer value, I think > it would be less error prone to ask for the location instead of an arbitrary > value. Currently, a confused caller could put a non-null value int

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439078. wyt added a comment. Use QualType as key to singleton map, implement getOrCreate factory function for retrieving null pointer values. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128056/new/ https://revie

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I am wondering about the future plans regarding how pointers are represented. What will be the expected behavior when the analysis discovers that the pointer has a null value? E.g.: if (p == nullptr) { } Would we expect `p` in this case to have the same

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-17 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When a `nullptr` is assigned to a pointer variable, it is wrapped in a `Imp