@@ -718,16 +730,24 @@ class Environment {
void pushCallInternal(const FunctionDecl *FuncDecl,
ArrayRef Args);
+ // FIXME: Add support for resetting globals after function calls to enable
+ // the implementation of sound analyses.
@@ -164,23 +169,28 @@ class Environment {
Environment =(Environment &) = default;
/// Creates an environment that uses `DACtx` to store objects that encompass
- /// the state of a program.
- ///
- /// If `DeclCtx` is a function, initializes the environment with
@@ -290,13 +295,13 @@ widenKeyToValueMap(const llvm::MapVector
,
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 propagates the
@@ -290,13 +295,13 @@ widenKeyToValueMap(const llvm::MapVector
,
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 propagates the
@@ -403,4 +405,35 @@ TEST_F(EnvironmentTest,
Contains(Member));
}
+TEST_F(EnvironmentTest, Stmt) {
+ using namespace ast_matchers;
+
+ std::string Code = R"cc(
+ struct S {int i;};
+ void foo() {
+S AnS = S{1};
+ }
@@ -403,4 +405,35 @@ TEST_F(EnvironmentTest,
Contains(Member));
}
+TEST_F(EnvironmentTest, Stmt) {
+ using namespace ast_matchers;
+
+ std::string Code = R"cc(
+ struct S {int i;};
+ void foo() {
+S AnS = S{1};
+ }
+)cc";
+ auto
@@ -146,6 +146,30 @@ TEST_F(DataflowAnalysisTest,
DiagnoseFunctionDiagnoserCalledOnEachElement) {
" (Lifetime ends)\n")));
}
+TEST_F(DataflowAnalysisTest, CanAnalyzeStmt) {
+ std::string Code = R"cc(
+ struct S {int i;};
+ S
@@ -146,6 +146,30 @@ TEST_F(DataflowAnalysisTest,
DiagnoseFunctionDiagnoserCalledOnEachElement) {
" (Lifetime ends)\n")));
}
+TEST_F(DataflowAnalysisTest, CanAnalyzeStmt) {
+ std::string Code = R"cc(
+ struct S {int i;};
+ S
@@ -146,6 +146,30 @@ TEST_F(DataflowAnalysisTest,
DiagnoseFunctionDiagnoserCalledOnEachElement) {
" (Lifetime ends)\n")));
}
+TEST_F(DataflowAnalysisTest, CanAnalyzeStmt) {
+ std::string Code = R"cc(
+ struct S {int i;};
+ S
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/91616
>From b62a95001e32a0c1d63204950481eb500c9d0275 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 9 May 2024 12:00:06 -0400
Subject: [PATCH 1/7] [clang][dataflow] Fully support Environment construction
for
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/91616
>From b62a95001e32a0c1d63204950481eb500c9d0275 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 9 May 2024 12:00:06 -0400
Subject: [PATCH 1/6] [clang][dataflow] Fully support Environment construction
for
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/91616
>From b62a95001e32a0c1d63204950481eb500c9d0275 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 9 May 2024 12:00:06 -0400
Subject: [PATCH 1/5] [clang][dataflow] Fully support Environment construction
for
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/91616
>From b62a95001e32a0c1d63204950481eb500c9d0275 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 9 May 2024 12:00:06 -0400
Subject: [PATCH 1/4] [clang][dataflow] Fully support Environment construction
for
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/91616
>From b62a95001e32a0c1d63204950481eb500c9d0275 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 9 May 2024 12:00:06 -0400
Subject: [PATCH 1/3] [clang][dataflow] Fully support Environment construction
for
bazuzi wrote:
I agree with the usefulness of storing the initial target separately, reducing
checks and branching based on whether the current target is a `Stmt` or
`Function`. Since I was touching everywhere `CallStack` was used anyway, I went
ahead with not pushing the starting
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/91616
>From b62a95001e32a0c1d63204950481eb500c9d0275 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 9 May 2024 12:00:06 -0400
Subject: [PATCH 1/2] [clang][dataflow] Fully support Environment construction
for
bazuzi wrote:
@ymand Can you review and eventually merge for me?
https://github.com/llvm/llvm-project/pull/91616
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/91616
Assume in fewer places that the analysis is of a FunctionDecl, and initialize
the Environment properly for Stmts.
Moves constructors for Environment to header to make it more obvious that there
are only minor
bazuzi wrote:
Ha, so fast I hadn't even hit send to ask for you to review yet. Can you merge
for me?
https://github.com/llvm/llvm-project/pull/89444
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/89444
None
>From e7b1540984306bfb36a59fa7692208bfaf2bdc1a Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Fri, 19 Apr 2024 15:09:32 -0400
Subject: [PATCH] [clang][dataflow] Expose getReferencedDecls for a Stmt.
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/88754
>From 223d4c48abf27c8b0949ac1520b66ef32cbd63c1 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Fri, 12 Apr 2024 12:18:44 -0400
Subject: [PATCH 1/4] [clang][dataflow] Expose fields, globals, and functions
bazuzi wrote:
@ymand @martinboehme Apologies for the broken chains of comments; can you take
another look?
https://github.com/llvm/llvm-project/pull/88754
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/88754
Moves free functions from DataflowEnvironment.h/cc and
DataflowAnalysisContext.h/cc to RecordOps and a new ASTOps and exposes them as
needed for current use and to expose getReferencedDecls for out-of-tree use.
bazuzi wrote:
@ymand Can you review and merge?
https://github.com/llvm/llvm-project/pull/88534
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/88534
Exposes the collection functionality, but does not alter it beyond using a
return value instead of output parameters. Also relocates underlying and
related functions and a class from DataflowEnvironment's files
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/83013
>From ee395ff3555efa5cbeae4d874f3ad39c52b85faf Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Mon, 26 Feb 2024 10:00:48 -0500
Subject: [PATCH 1/2] [clang][dataflow] Skip array types when handling
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/83013
Crashes resulted from single-element InitListExprs for arrays with elements of
a record type after #80970.
>From ee395ff3555efa5cbeae4d874f3ad39c52b85faf Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Mon,
https://github.com/bazuzi edited https://github.com/llvm/llvm-project/pull/82856
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bazuzi wrote:
@ymand Can you merge this?
https://github.com/llvm/llvm-project/pull/82856
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/82856
Reverts llvm/llvm-project#82348, which caused crashes when analyzing empty
InitListExprs for unions.
>From ae17f89f38d56c2aa9feaa1ebfc7a641b41dc068 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Fri, 23 Feb
@@ -648,6 +648,12 @@ class TransferVisitor : public
ConstStmtVisitor {
QualType Type = S->getType();
if (!Type->isStructureOrClassType()) {
+ // It is possible that InitListExpr is not a prvalue, in which case
+ // `setValue` will fail. In this case, we can
bazuzi wrote:
@martinboehme or @ymand Could you take a look and merge?
The only modification from https://github.com/llvm/llvm-project/pull/73978 is
the `Env.initialize()` in the test.
https://github.com/llvm/llvm-project/pull/74336
___
cfe-commits
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/74336
…ng member pointers.
This initially landed with a broken test due to a mid-air collision with a new
requirement for Environment initialization before field modeling. Have added
that initialization in the test.
bazuzi wrote:
Can you merge for me, now that I've finally remembered to format everything?
https://github.com/llvm/llvm-project/pull/73978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/73978
>From aab1069636896c4a8289545ba01d2fdf4f1715c0 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 30 Nov 2023 14:18:04 -0500
Subject: [PATCH 1/4] [clang][dataflow] Retrieve members from accessors called
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/73978
>From aab1069636896c4a8289545ba01d2fdf4f1715c0 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 30 Nov 2023 14:18:04 -0500
Subject: [PATCH 1/3] [clang][dataflow] Retrieve members from accessors called
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/73978
>From aab1069636896c4a8289545ba01d2fdf4f1715c0 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 30 Nov 2023 14:18:04 -0500
Subject: [PATCH 1/2] [clang][dataflow] Retrieve members from accessors called
@@ -300,9 +300,10 @@ static void insertIfFunction(const Decl ,
}
static MemberExpr *getMemberForAccessor(const CXXMemberCallExpr ) {
- if (!C.getMethodDecl())
+ const auto *MethodDecl = dyn_cast_or_null(C.getCalleeDecl());
bazuzi wrote:
Done
bazuzi wrote:
@ymand Can you review?
https://github.com/llvm/llvm-project/pull/73978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bazuzi wrote:
Could you merge for me? I don't have write access.
https://github.com/llvm/llvm-project/pull/71573
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/71573
>From d6b87c3ff427d6425d2559e9731d88b89f2206c8 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Tue, 7 Nov 2023 13:44:51 -0500
Subject: [PATCH 1/2] [clang][dataflow] Compare an unqualified type to an
bazuzi wrote:
@martinboehme Could you review?
https://github.com/llvm/llvm-project/pull/71573
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/71573
Includes crash-reproducing test case.
>From d6b87c3ff427d6425d2559e9731d88b89f2206c8 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Tue, 7 Nov 2023 13:44:51 -0500
Subject: [PATCH] [clang][dataflow] Compare
43 matches
Mail list logo