[clang] Skip escaped newlines before checking for whitespace in Lexer::getRawToken. (PR #117548)

2024-12-05 Thread Samira Bazuzi via cfe-commits
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

[clang] Skip escaped newlines before checking for whitespace in Lexer::getRawToken. (PR #117548)

2024-12-04 Thread Samira Bazuzi via 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

[clang] Skip escaped newlines before checking for whitespace in Lexer::getRawToken. (PR #117548)

2024-11-27 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-27 Thread Samira Bazuzi via cfe-commits
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

[clang] Skip escaped newlines before checking for whitespace in Lexer::getRawToken. (PR #117548)

2024-11-26 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Samira Bazuzi via 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 + /// empty except when

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Samira Bazuzi via cfe-commits
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

[clang] Skip escaped newlines before checking for whitespace in Lexer::getRawToken. (PR #117548)

2024-11-26 Thread Samira Bazuzi via 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

[clang] Treat escaped newlines as whitespace in Lexer::getRawToken. (PR #117548)

2024-11-26 Thread Samira Bazuzi via 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.

[clang] Treat escaped newlines as whitespace in Lexer::getRawToken. (PR #117548)

2024-11-26 Thread Samira Bazuzi via cfe-commits
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

[clang] Treat escaped newlines as whitespace in Lexer::getRawToken. (PR #117548)

2024-11-25 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Disambiguate a ref to "internal" in CachedConstAccessorsLattice (PR #113601)

2024-10-25 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Only propagate past CXXDefaultInitExpr if init is (PR #99236)

2024-09-10 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-19 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-19 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-16 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-15 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-15 Thread Samira Bazuzi via 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

[clang] [llvm] Return available function types for BindingDecls. (PR #102196)

2024-08-09 Thread Samira Bazuzi via cfe-commits
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

[clang] [llvm] Return available function types for BindingDecls. (PR #102196)

2024-08-09 Thread Samira Bazuzi via 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

[clang] [llvm] Return available function types for BindingDecls. (PR #102196)

2024-08-07 Thread Samira Bazuzi via 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 _

[clang] [llvm] Return available function types for BindingDecls. (PR #102196)

2024-08-07 Thread Samira Bazuzi via cfe-commits
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

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Samira Bazuzi via cfe-commits
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

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Samira Bazuzi via cfe-commits
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(

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Samira Bazuzi via cfe-commits
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

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Samira Bazuzi via cfe-commits
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

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Handle this-capturing lambdas in field initializers. (PR #99519)

2024-07-18 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Handle this-capturing lambdas in field initializers. (PR #99519)

2024-07-18 Thread Samira Bazuzi via 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 -

[clang] [clang][dataflow] Only propagate past CXXDefaultInitExpr if init is (PR #99236)

2024-07-17 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Only propagate past CXXDefaultInitExpr if init is (PR #99236)

2024-07-16 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow]Propagate the result object location for CXXDefaultInitExpr. (PR #98490)

2024-07-12 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow]Propagate the result object location for CXXDefaultInitExpr. (PR #98490)

2024-07-12 Thread Samira Bazuzi via 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

[clang] Propagate the result object location for CXXDefaultInitExpr. (PR #98490)

2024-07-12 Thread Samira Bazuzi via 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.

[clang] Propagate the result object location for CXXDefaultInitExpr. (PR #98490)

2024-07-11 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-09 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-09 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-09 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Expose getReferencedDecls for a Stmt. (PR #89444)

2024-04-19 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Expose getReferencedDecls for a Stmt. (PR #89444)

2024-04-19 Thread Samira Bazuzi via cfe-commits
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. ---

[clang] [clang][dataflow] Expose getReferencedDecls and relocate free functions. (PR #88754)

2024-04-16 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Expose getReferencedDecls and relocate free functions. (PR #88754)

2024-04-15 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Expose getReferencedDecls and relocate free functions. (PR #88754)

2024-04-15 Thread Samira Bazuzi via cfe-commits
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.

[clang] [clang][dataflow] Expose fields, globals, and functions referenced. (PR #88534)

2024-04-12 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Expose fields, globals, and functions referenced. (PR #88534)

2024-04-12 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Skip array types when handling InitListExprs. (PR #83013)

2024-02-26 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Skip array types when handling InitListExprs. (PR #83013)

2024-02-26 Thread Samira Bazuzi via cfe-commits
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

[clang] Revert "[clang][dataflow] Correctly handle `InitListExpr` of union type." (PR #82856)

2024-02-23 Thread Samira Bazuzi via cfe-commits
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

[clang] Revert "[clang][dataflow] Correctly handle `InitListExpr` of union type." (PR #82856)

2024-02-23 Thread Samira Bazuzi via 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

[clang] Revert "[clang][dataflow] Correctly handle `InitListExpr` of union type." (PR #82856)

2024-02-23 Thread Samira Bazuzi via 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

[clang] [dataflow] Fix crash when InitListExpr is not a prvalue (PR #80970)

2024-02-22 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Re-land: Retrieve members from accessors called usi… (PR #74336)

2023-12-04 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Re-land: Retrieve members from accessors called usi… (PR #74336)

2023-12-04 Thread Samira Bazuzi via 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.

[clang] [clang][dataflow] Retrieve members from accessors called using member… (PR #73978)

2023-12-01 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Retrieve members from accessors called using member… (PR #73978)

2023-12-01 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Retrieve members from accessors called using member… (PR #73978)

2023-12-01 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Retrieve members from accessors called using member… (PR #73978)

2023-12-01 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Retrieve members from accessors called using member… (PR #73978)

2023-12-01 Thread Samira Bazuzi via cfe-commits
@@ -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

[clang] [clang][dataflow] Retrieve members from accessors called using member… (PR #73978)

2023-11-30 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Fix buggy assertion: Compare an unqualified type to an unqualified type. (PR #71573)

2023-11-09 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Fix buggy assertion: Compare an unqualified type to an unqualified type. (PR #71573)

2023-11-08 Thread Samira Bazuzi via 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

[clang] [clang][dataflow] Compare an unqualified type to an unqualified type. (PR #71573)

2023-11-07 Thread Samira Bazuzi via cfe-commits
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

[clang] [clang][dataflow] Compare an unqualified type to an unqualified type. (PR #71573)

2023-11-07 Thread Samira Bazuzi via 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