martinboehme wrote:
This is causing buildbots to fail because `isOriginalRecordConstructor()` is
now unused. Reverting.
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/martinboehme closed
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
martinboehme wrote:
CI failure looks unrelated
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
martinboehme wrote:
Rebased to head and resolved merge conflicts.
Will merge once checks pass.
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/martinboehme updated
https://github.com/llvm/llvm-project/pull/87320
>From 96ca0820189c5c022a9a0501391e2ab6e08f6677 Mon Sep 17 00:00:00 2001
From: Martin Braenne
Date: Tue, 2 Apr 2024 08:00:00 +
Subject: [PATCH 1/3] [clang][dataflow] Propagate locations from result
https://github.com/Xazax-hun approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6830,50 +6932,6 @@ TEST(TransferTest, LambdaCaptureThis) {
});
}
-TEST(TransferTest, DifferentReferenceLocInJoin) {
martinboehme wrote:
See explanation in PR description. (tl;dr: We can no longer set up the desired
situation, so I replaced this
@@ -556,6 +763,10 @@ void Environment::pushCallInternal(const FunctionDecl
*FuncDecl,
const VarDecl *Param = *ParamIt;
setStorageLocation(*Param, createObject(*Param, Args[ArgIndex]));
}
+
+ ResultObjectMap = std::make_shared(
martinboehme wrote:
@@ -385,6 +390,187 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
https://github.com/martinboehme updated
https://github.com/llvm/llvm-project/pull/87320
>From 2d2aa88aab3e47e41588397471a90c03bb55d900 Mon Sep 17 00:00:00 2001
From: Martin Braenne
Date: Tue, 2 Apr 2024 08:00:00 +
Subject: [PATCH 1/3] [clang][dataflow] Propagate locations from result
@@ -385,6 +390,187 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
martinboehme wrote:
> I know it is not exactly what we need, but I found
> `Expr::skipRValueSubobjectAdjustments` in the compiler. I think it might be a
> good idea to take a look just in case there is something we forgot to cover,
> and maybe in the future we could look for factoring out
@@ -6830,50 +6932,6 @@ TEST(TransferTest, LambdaCaptureThis) {
});
}
-TEST(TransferTest, DifferentReferenceLocInJoin) {
Xazax-hun wrote:
What is the main reason for removing this test?
https://github.com/llvm/llvm-project/pull/87320
@@ -385,6 +390,187 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
@@ -556,6 +763,10 @@ void Environment::pushCallInternal(const FunctionDecl
*FuncDecl,
const VarDecl *Param = *ParamIt;
setStorageLocation(*Param, createObject(*Param, Args[ArgIndex]));
}
+
+ ResultObjectMap = std::make_shared(
Xazax-hun wrote:
I
https://github.com/Xazax-hun commented:
I know it is not exactly what we need, but I found
`Expr::skipRValueSubobjectAdjustments` in the compiler. I think it might be a
good idea to take a look just in case there is something we forgot to cover,
and maybe in the future we could look for
@@ -385,6 +390,187 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -688,22 +689,45 @@ class Environment {
/// and functions referenced in `FuncDecl`. `FuncDecl` must have a body.
void initFieldsGlobalsAndFuncs(const FunctionDecl *FuncDecl);
+ static PrValueToResultObject
+ buildResultObjectMap(DataflowAnalysisContext *DACtx,
+
martinboehme wrote:
I think all comments should be addressed.
@Xazax-hun Should be ready for further review.
@ymand LMK if you have any additional comments.
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
@@ -385,6 +388,185 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
@@ -460,25 +460,35 @@ class TransferVisitor : public
ConstStmtVisitor {
// So make sure we have a value if we didn't propagate one above.
if (S->isPRValue() && S->getType()->isRecordType()) {
if (Env.getValue(*S) == nullptr) {
-Value *Val =
https://github.com/martinboehme updated
https://github.com/llvm/llvm-project/pull/87320
>From 2d2aa88aab3e47e41588397471a90c03bb55d900 Mon Sep 17 00:00:00 2001
From: Martin Braenne
Date: Tue, 2 Apr 2024 08:00:00 +
Subject: [PATCH 1/2] [clang][dataflow] Propagate locations from result
@@ -688,71 +682,51 @@ class TransferVisitor : public
ConstStmtVisitor {
return;
}
-llvm::DenseMap FieldLocs;
-RecordInitListHelper InitListHelper(S);
+RecordStorageLocation = Env.getResultObjectLocation(*S);
+Env.setValue(*S,
@@ -460,25 +460,35 @@ class TransferVisitor : public
ConstStmtVisitor {
// So make sure we have a value if we didn't propagate one above.
if (S->isPRValue() && S->getType()->isRecordType()) {
if (Env.getValue(*S) == nullptr) {
-Value *Val =
@@ -385,6 +388,185 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
@@ -688,22 +689,45 @@ class Environment {
/// and functions referenced in `FuncDecl`. `FuncDecl` must have a body.
void initFieldsGlobalsAndFuncs(const FunctionDecl *FuncDecl);
+ static PrValueToResultObject
+ buildResultObjectMap(DataflowAnalysisContext *DACtx,
+
@@ -688,22 +689,45 @@ class Environment {
/// and functions referenced in `FuncDecl`. `FuncDecl` must have a body.
void initFieldsGlobalsAndFuncs(const FunctionDecl *FuncDecl);
+ static PrValueToResultObject
+ buildResultObjectMap(DataflowAnalysisContext *DACtx,
+
@@ -385,6 +388,185 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
@@ -688,22 +689,45 @@ class Environment {
/// and functions referenced in `FuncDecl`. `FuncDecl` must have a body.
void initFieldsGlobalsAndFuncs(const FunctionDecl *FuncDecl);
+ static PrValueToResultObject
+ buildResultObjectMap(DataflowAnalysisContext *DACtx,
+
@@ -688,22 +689,45 @@ class Environment {
/// and functions referenced in `FuncDecl`. `FuncDecl` must have a body.
void initFieldsGlobalsAndFuncs(const FunctionDecl *FuncDecl);
+ static PrValueToResultObject
+ buildResultObjectMap(DataflowAnalysisContext *DACtx,
+
@@ -385,6 +388,185 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet ,
}
}
+namespace {
+
+// Visitor that builds a map from record prvalues to result objects.
+// This traverses the body of the function to be analyzed; for each result
+// object that it encounters, it
https://github.com/Xazax-hun commented:
I did not finish reviewing this, but wanted to send a couple of questions early
to parallelize the process a bit.
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/87320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-analysis
Author: None (martinboehme)
Changes
Previously, we were propagating storage locations the other way around, i.e.
from initializers to result objects, using `RecordValue::getLoc()`. This gave
the wrong behavior
https://github.com/martinboehme created
https://github.com/llvm/llvm-project/pull/87320
Previously, we were propagating storage locations the other way around, i.e.
from initializers to result objects, using `RecordValue::getLoc()`. This gave
the wrong behavior in some cases -- see the newly
36 matches
Mail list logo