https://github.com/martinboehme closed
https://github.com/llvm/llvm-project/pull/73860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
martinboehme wrote:
> Overall, I love it! I have some comments on some features in the future, but
> those are probably not going to be addressed any time soon. First of all, I
> think in the future when we reason about the values of the pointers,
> synthetic fields might need to have offsets
@@ -367,3 +394,14 @@ clang::dataflow::FieldSet
clang::dataflow::getObjectFields(QualType Type) {
getFieldsFromClassHierarchy(Type, Fields);
return Fields;
}
+
+bool clang::dataflow::containsSameFields(
+const clang::dataflow::FieldSet ,
+const
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/73860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun approved this pull request.
Overall, I love it! I have some comments on some features in the future, but
those are probably not going to be addressed any time soon. First of all, I
think in the future when we reason about the values of the pointers, synthetic
@@ -367,3 +394,14 @@ clang::dataflow::FieldSet
clang::dataflow::getObjectFields(QualType Type) {
getFieldsFromClassHierarchy(Type, Fields);
return Fields;
}
+
+bool clang::dataflow::containsSameFields(
+const clang::dataflow::FieldSet ,
+const
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/73860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -88,12 +94,12 @@ class ScalarStorageLocation final : public StorageLocation {
class RecordStorageLocation final : public StorageLocation {
public:
using FieldToLoc = llvm::DenseMap;
+ using SyntheticFieldMap = llvm::StringMap;
martinboehme wrote:
This
@@ -92,11 +96,39 @@ class DataflowAnalysisContext {
/*Logger=*/nullptr});
~DataflowAnalysisContext();
+ /// Sets a callback that returns the names and types of the synthetic fields
+ /// to add to a `RecordStorageLocation` of a given type.
+
@@ -54,6 +54,18 @@ void clang::dataflow::copyRecord(RecordStorageLocation ,
}
}
+ for (const auto &[Name, PropLocSrc] : Src.synthetic_fields()) {
+if (PropLocSrc->getType()->isRecordType()) {
+ copyRecord(*cast(PropLocSrc),
+
@@ -73,7 +73,13 @@ class ScalarStorageLocation final : public StorageLocation {
///
/// Contains storage locations for all modeled fields of the record (also
/// referred to as "children"). The child map is flat, so accessible members of
-/// the base class are directly
@@ -92,11 +96,39 @@ class DataflowAnalysisContext {
/*Logger=*/nullptr});
~DataflowAnalysisContext();
+ /// Sets a callback that returns the names and types of the synthetic fields
+ /// to add to a `RecordStorageLocation` of a given type.
+
@@ -92,11 +96,39 @@ class DataflowAnalysisContext {
/*Logger=*/nullptr});
~DataflowAnalysisContext();
+ /// Sets a callback that returns the names and types of the synthetic fields
+ /// to add to a `RecordStorageLocation` of a given type.
+
@@ -492,6 +492,56 @@ transferCFGBlock(const CFGBlock , AnalysisContext
,
return State;
}
+static Environment initializeEnvironment(const Environment ) {
+ Environment ResultEnv = InitEnv.fork();
martinboehme wrote:
Now that this code has been moved to
@@ -492,6 +492,56 @@ transferCFGBlock(const CFGBlock , AnalysisContext
,
return State;
}
+static Environment initializeEnvironment(const Environment ) {
martinboehme wrote:
> Why not include this function as part of the Environment API?
Good point --
https://github.com/martinboehme updated
https://github.com/llvm/llvm-project/pull/73860
>From a7138289989afaa1348185e52469d670c316eb45 Mon Sep 17 00:00:00 2001
From: Martin Braenne
Date: Wed, 29 Nov 2023 21:32:55 +
Subject: [PATCH 1/4] [clang][dataflow] Defer initialization of
@@ -92,11 +96,39 @@ class DataflowAnalysisContext {
/*Logger=*/nullptr});
~DataflowAnalysisContext();
+ /// Sets a callback that returns the names and types of the synthetic fields
+ /// to add to a `RecordStorageLocation` of a given type.
+
@@ -92,11 +96,39 @@ class DataflowAnalysisContext {
/*Logger=*/nullptr});
~DataflowAnalysisContext();
+ /// Sets a callback that returns the names and types of the synthetic fields
+ /// to add to a `RecordStorageLocation` of a given type.
+
@@ -88,12 +94,12 @@ class ScalarStorageLocation final : public StorageLocation {
class RecordStorageLocation final : public StorageLocation {
public:
using FieldToLoc = llvm::DenseMap;
+ using SyntheticFieldMap = llvm::StringMap;
Xazax-hun wrote:
I was
https://github.com/Xazax-hun commented:
I generally love this direction, this was just a first pass, not a full review.
I plan to take a second look but wanted to familiarize myself with the PR and
start some conversations.
https://github.com/llvm/llvm-project/pull/73860
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/73860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -92,11 +96,39 @@ class DataflowAnalysisContext {
/*Logger=*/nullptr});
~DataflowAnalysisContext();
+ /// Sets a callback that returns the names and types of the synthetic fields
+ /// to add to a `RecordStorageLocation` of a given type.
+
@@ -492,6 +492,56 @@ transferCFGBlock(const CFGBlock , AnalysisContext
,
return State;
}
+static Environment initializeEnvironment(const Environment ) {
+ Environment ResultEnv = InitEnv.fork();
ymand wrote:
Why `fork`? The function name implies that the
@@ -492,6 +492,56 @@ transferCFGBlock(const CFGBlock , AnalysisContext
,
return State;
}
+static Environment initializeEnvironment(const Environment ) {
ymand wrote:
Why not include this function as part of the Environment API? At the least,
please
@@ -54,6 +54,18 @@ void clang::dataflow::copyRecord(RecordStorageLocation ,
}
}
+ for (const auto &[Name, PropLocSrc] : Src.synthetic_fields()) {
+if (PropLocSrc->getType()->isRecordType()) {
+ copyRecord(*cast(PropLocSrc),
+
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/73860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -73,7 +73,13 @@ class ScalarStorageLocation final : public StorageLocation {
///
/// Contains storage locations for all modeled fields of the record (also
/// referred to as "children"). The child map is flat, so accessible members of
-/// the base class are directly
https://github.com/ymand approved this pull request.
This is amazing! I spent a while searching for changes to join/widen to account
for synthetic fields and then realized that (of course!) no special handling is
needed!
I also love that we now have the hooks we've wanted since the beginning.
28 matches
Mail list logo