[clang] [clang][dataflow] Add synthetic fields to `RecordStorageLocation` (PR #73860)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 06:16:23 PST 2023


================
@@ -54,6 +54,18 @@ void clang::dataflow::copyRecord(RecordStorageLocation &Src,
     }
   }
 
+  for (const auto &[Name, PropLocSrc] : Src.synthetic_fields()) {
+    if (PropLocSrc->getType()->isRecordType()) {
+      copyRecord(*cast<RecordStorageLocation>(PropLocSrc),
+                 cast<RecordStorageLocation>(Dst.getSyntheticField(Name)), Env);
+    } else {
+      if (Value *Val = Env.getValue(*PropLocSrc))
----------------
ymand wrote:

nit: why not just `else if`?

https://github.com/llvm/llvm-project/pull/73860


More information about the cfe-commits mailing list