https://github.com/bazuzi closed
https://github.com/llvm/llvm-project/pull/117548
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bazuzi wrote:
Anything else I should add before merging this?
https://github.com/llvm/llvm-project/pull/117548
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bazuzi wrote:
Added a test for getRawToken where the EXPECT_TRUE failed before this change.
https://github.com/llvm/llvm-project/pull/117548
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
https://github.com/bazuzi closed
https://github.com/llvm/llvm-project/pull/117771
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi edited
https://github.com/llvm/llvm-project/pull/117548
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -146,6 +146,10 @@ struct ReferencedDecls {
/// Free functions and member functions which are referenced (but not
/// necessarily called).
llvm::DenseSet Functions;
+ /// Parameters of other functions, captured by reference by a lambda. This is
bazuzi
@@ -146,6 +146,10 @@ struct ReferencedDecls {
/// Free functions and member functions which are referenced (but not
/// necessarily called).
llvm::DenseSet Functions;
+ /// Parameters of other functions, captured by reference by a lambda. This is
+ /// empty except when
@@ -281,6 +282,17 @@ ReferencedDecls getReferencedDecls(const FunctionDecl &FD)
{
Visitor.TraverseStmt(FD.getBody());
if (const auto *CtorDecl = dyn_cast(&FD))
Visitor.traverseConstructorInits(CtorDecl);
+ if (const auto *Method = dyn_cast(&FD);
bazuz
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/117771
>From cc7305af699191867bf6d3c9e73f72f2d8754ebd Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Tue, 26 Nov 2024 14:19:16 -0500
Subject: [PATCH 1/2] [clang][dataflow] Add captured parameters to
ReferencedDecls
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/117771
…da call operators.
This doesn't require that they be used in the operator's body, unlike other
ReferencedDecls. This is most obviously different from captured local
variables, which can be captured but will no
https://github.com/bazuzi edited
https://github.com/llvm/llvm-project/pull/117548
___
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/117548
>From 9c8b31dc266b770927785834c841b8ae5a7ebb58 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Fri, 22 Nov 2024 15:45:55 -0500
Subject: [PATCH 1/2] Treat escaped newlines as whitespace in
Lexer::getRawToken.
bazuzi wrote:
> > If an escaped newline should not be considered whitespace, then instead of
> > this change, getRawToken should be modified to return true when whitespace
> > follows the escaped newline present at Loc
>
> That sounds like a more promising approach. Is that something you would
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/117548
The Lexer used in getRawToken is not told to keep whitespace, so when it skips
over escaped newlines, it also ignores whitespace, regardless of getRawToken's
IgnoreWhiteSpace parameter. My suspicion is that user
https://github.com/bazuzi approved this pull request.
https://github.com/llvm/llvm-project/pull/113601
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi closed https://github.com/llvm/llvm-project/pull/99236
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bazuzi wrote:
Added a test.
https://github.com/llvm/llvm-project/pull/104459
___
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/104459
>From 5aaa8c5e65b59b0f21775811f48dec350ae210c7 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 15 Aug 2024 11:11:30 -0400
Subject: [PATCH 1/2] [clang][dataflow] Collect local variables referenced
within
bazuzi wrote:
The new `Locals` field can be, and is by default, ignored, as the existing uses
iterate individually through each of the sets in `ReferencedDecls`.
https://github.com/llvm/llvm-project/pull/104459
___
cfe-commits mailing list
cfe-commits
bazuzi wrote:
@ymand Can you review and eventually merge for me?
https://github.com/llvm/llvm-project/pull/104459
___
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/104459
…n/statement.
We don't need these for the same in-tree purposes as the other sets, i.e. for
making sure we model these Decls that are declared outside the function, but we
have an out-of-tree use for these sets
bazuzi wrote:
Yes, thanks!
https://github.com/llvm/llvm-project/pull/102196
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bazuzi wrote:
Any additional questions on this @mizvekov?
https://github.com/llvm/llvm-project/pull/102196
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bazuzi wrote:
The fact that the code that revealed this bug was in a dataflow analysis isn't
really relevant to the fix. I've added a unit test file with a new test limited
only to the modified behavior of getFunctionType for BindingDecls.
https://github.com/llvm/llvm-project/pull/102196
_
https://github.com/bazuzi updated
https://github.com/llvm/llvm-project/pull/102196
>From 052eff82638bdfbc8c7b8a2b90bcd9a0c46e52c4 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Tue, 6 Aug 2024 14:11:46 -0400
Subject: [PATCH 1/2] Return available function types for BindingDecls.
Only return
bazuzi wrote:
This is a pointer nullability analysis being developed outside of clang. The
relevant analysis code, including our workaround, can be seen at
https://github.com/google/crubit/blob/main/nullability/inference/collect_evidence.cc#L757.
https://github.com/llvm/llvm-project/pull/10219
bazuzi wrote:
For the following:
```
template
struct Pair {
Pair();
A a;
B b;
};
void target(int *i) {
Pair p;
auto [fp, b] = p;
fp(i);
}
```
Running or compiling this code presents no misbehavior that I know of, but when
running a dataflow analysis that queries `getFunctionType(
bazuzi wrote:
This is a bug fix, yes, but there are currently no tests at all for this
function that I can find (and no test file corresponding to this file or its
header), so I'm not sure what the scope of a new unit test should be. I also
don't know how I would most realistically trigger the
bazuzi wrote:
Thanks for the quick review! Could you merge for me? I don't have write access.
https://github.com/llvm/llvm-project/pull/102196
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/102196
Only return nullptr when we don't have an available QualType.
>From 052eff82638bdfbc8c7b8a2b90bcd9a0c46e52c4 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Tue, 6 Aug 2024 14:11:46 -0400
Subject: [PATCH] Ret
bazuzi wrote:
@ymand Can you review and eventually merge for me?
https://github.com/llvm/llvm-project/pull/99519
___
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/99519
We previously would assume these were inside a method definition and end up
crashing.
>From 23f74d7f2e0864d4cc667fa191a8511b2759428f Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 18 Jul 2024 11:07:03 -
@@ -465,7 +465,12 @@ class ResultObjectVisitor : public
AnalysisASTVisitor {
}
if (auto *DIE = dyn_cast(E)) {
- PropagateResultObject(DIE->getExpr(), Loc);
+ // If it has a rewritten init, we should propagate to that. If it
doesn't,
+ // then the CXXDe
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/99236
rewritten.
>From 7c75181c590f30cc439af6fa523f3ca78f8a933d Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Tue, 16 Jul 2024 16:25:32 -0400
Subject: [PATCH] [clang][dataflow] Only propagate past CXXDefaultInitEx
bazuzi wrote:
Thanks for the review. Could you merge for me? I don't have commit access.
https://github.com/llvm/llvm-project/pull/98490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bazuzi edited https://github.com/llvm/llvm-project/pull/98490
___
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/98490
>From 8f51730d1f4bbca740a01b89780b6ed9bee3c3d7 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 11 Jul 2024 09:56:17 -0400
Subject: [PATCH 1/2] Propagate the result object location for
CXXDefaultInitExpr.
https://github.com/bazuzi created
https://github.com/llvm/llvm-project/pull/98490
These are not "original initializers"; the single node underneath represents
the initializing node.
>From 8f51730d1f4bbca740a01b89780b6ed9bee3c3d7 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi
Date: Thu, 11 Jul 2
@@ -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.
ba
@@ -164,23 +169,28 @@ class Environment {
Environment &operator=(Environment &&Other) = default;
/// Creates an environment that uses `DACtx` to store objects that encompass
- /// the state of a program.
- ///
- /// If `DeclCtx` is a function, initializes the environmen
@@ -290,13 +295,13 @@ widenKeyToValueMap(const llvm::MapVector
&CurMap,
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 th
@@ -290,13 +295,13 @@ widenKeyToValueMap(const llvm::MapVector
&CurMap,
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 th
@@ -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};
+ }
bazuzi
@@ -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 Unit
@@ -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 getAn
@@ -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 getAn
@@ -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 getAn
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 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/6] [clang][dataflow] Fully support Environment construction
for 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/5] [clang][dataflow] Fully support Environment construction
for 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/4] [clang][dataflow] Fully support Environment construction
for 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/3] [clang][dataflow] Fully support Environment construction
for S
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 `FunctionDecl
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 S
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 di
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://lists.llvm.org/cgi-bin/mailman/listinf
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
refer
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://lists.llvm.org/cgi-bin/mailman/l
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 t
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
InitListExpr
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, 2
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 m
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://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
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
usin
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
usin
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
usin
@@ -300,9 +300,10 @@ static void insertIfFunction(const Decl &D,
}
static MemberExpr *getMemberForAccessor(const CXXMemberCallExpr &C) {
- if (!C.getMethodDecl())
+ const auto *MethodDecl = dyn_cast_or_null(C.getCalleeDecl());
bazuzi wrote:
Done
https://gi
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
unqualifie
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 an
81 matches
Mail list logo