[PATCH] D154935: [clang][dataflow] Introduce `getFieldValue()` test helpers.

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


mboehme added inline comments.


================
Comment at: clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp:95
-  StructValue *SVal = clang::dyn_cast<StructValue>(Val);
-  ASSERT_NE(SVal, nullptr);
-  Val = SVal->getChild(*R);
----------------
Using the opportunity to simplify the code here a bit: If we `cast<>`, we don't need to assert for non-nullness because `cast<>` already does that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154935



More information about the cfe-commits mailing list