[PATCH] D126420: [clang][dataflow] Remove private-field filtering from `StorageLocation` creation.

Stanislav Gatev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 25 14:02:24 PDT 2022


sgatev added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:407
 
     for (const FieldDecl *Field : getAccessibleObjectFields(Type)) {
       assert(Field != nullptr);
----------------
Why not use `getObjectFields` here too?


================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:523
     llvm::DenseMap<const ValueDecl *, Value *> FieldValues;
     for (const FieldDecl *Field : getAccessibleObjectFields(Type)) {
       assert(Field != nullptr);
----------------
Why not use `getObjectFields` here too?


================
Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:1252-1253
+               ASTContext &ASTCtx) {
+        // The purpose of this test is to verify non-crashing behavior for the
+        // analysis of the access to `Foo.Bar`. So, we
+        EXPECT_THAT(Results, ElementsAre(Pair("p", _)));
----------------
Might as well check that `Foo.Bar` is assigned a value like the `DerivedBaseMemberClass` test case?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126420/new/

https://reviews.llvm.org/D126420



More information about the cfe-commits mailing list