[clang] [clang][dataflow] Model assignment to derived class from base. (PR #85064)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 18 07:47:30 PDT 2024


================
@@ -14,18 +14,52 @@
 
 #define DEBUG_TYPE "dataflow"
 
-void clang::dataflow::copyRecord(RecordStorageLocation &Src,
-                                 RecordStorageLocation &Dst, Environment &Env) {
+namespace clang::dataflow {
+
+static void copyField(const ValueDecl *Field, StorageLocation *SrcFieldLoc,
----------------
Xazax-hun wrote:

> We could consider using StorageLocation constness to encode "can this storage location be written to"

I think there could be some benefit to something like this, in some cases it could catch "swapped arguments" at compile time. That being said, I do not insist. It is possible that it would not carry its weight.

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


More information about the cfe-commits mailing list