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 singleton value in the then block of the if statement? ================ Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:146 + /// `PointeeType`. + void setNullPointerVal(QualType PointeeType, PointerValue &Val) { + assert(NullPointerVals.find(PointeeType.getAsString()) == ---------------- 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 into a table. ================ Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:149 + NullPointerVals.end()); + NullPointerVals[PointeeType.getAsString()] = &Val; + } ---------------- I think `getAsString` is considered expensive. Could you use `QualType` directly as the key? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128056/new/ https://reviews.llvm.org/D128056 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits