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
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
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.
+ //
-
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
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
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
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));
+ }
---
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
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
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
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
11 matches
Mail list logo