[PATCH] D154952: [clang][dataflow] Various refactorings in TypeErasedDataflowAnalysisTest.cpp

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 11 05:11:11 PDT 2023


mboehme added inline comments.


================
Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:400
                           getASTContext()))) {
-      auto &ConstructorVal = *Env.createValue(E->getType());
-      ConstructorVal.setProperty("is_set", Env.getBoolLiteralValue(false));
-      Env.setValue(*Env.getStorageLocation(*E, SkipPast::None), ConstructorVal);
+      cast<StructValue>(Env.getValueStrict(*E))
+          ->setProperty("is_set", Env.getBoolLiteralValue(false));
----------------
This works because we know that constructor has already created a fresh value for `E`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154952



More information about the cfe-commits mailing list