@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/142313
>From 0cd187b01e61b200d92ca0b640789c1586075142 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Mon, 2 Jun 2025 17:53:14 +
Subject: [PATCH 1/2] Introduce Intra-procedural lifetime analysis in Clang
---
..
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
https://github.com/usx95 ready_for_review
https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/142313
>From cb7bd7f42796b716779a44732a885ea871697227 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Mon, 2 Jun 2025 17:53:14 +
Subject: [PATCH] Introduce Intra-procedural lifetime analysis in Clang
---
.../cl
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/142313
>From 942648ef075407d2c7a8e19414d604e254d53064 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Mon, 2 Jun 2025 17:53:14 +
Subject: [PATCH] Introduce Intra-procedural lifetime analysis in Clang
---
.../cl
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/142313
>From 362435938dabc949dbdae62edd1f0a2ba3c6d8c1 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Sun, 1 Jun 2025 15:44:37 +
Subject: [PATCH] Introduce Intra-procedural lifetime analysis in Clang
---
.../cl
https://github.com/usx95 approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/142195
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/142313
>From 0cd187b01e61b200d92ca0b640789c1586075142 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Mon, 2 Jun 2025 17:53:14 +
Subject: [PATCH] Introduce Intra-procedural lifetime analysis in Clang
---
.../cl
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2842,6 +2844,12 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
}
}
+ DEBUG_WITH_TYPE(
+ "ExperimentalLifetimeAnalysis", if (S.getLangOpts().CPlusPlus) {
usx95 wrote:
This is temporary to initially scope it to C++. Added a TODO to e
usx95 wrote:
> I have one question though. I sort of expected this to require a liveness
> analysis. Is this something we will need down the line? Or is that not
> required for polonius?
Good point. This is actually going to be a part of the error reporting. And
yes, polonius does have a noti
https://github.com/usx95 deleted
https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
> One question for the future: sometimes it might be better to run certain
> analyses side by side in the same worklist rather than running them
> sequentially after each other. Do you think there are some analysis steps
> that will be beneficial to be combined in that way?
That
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 3130ad5f5eb0d4df7bba305264cf9d5865f46bc6 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/3] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/148222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148967
>From 4a2336900f6343963f278df7426166463382b3c0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Tue, 15 Jul 2025 21:24:11 +
Subject: [PATCH] add-backward-analysis-capability
---
clang/lib/Analysis/Lifetim
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/148967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148967
>From b76c9160a608f6908119298001ec15599abaf051 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Tue, 15 Jul 2025 21:24:11 +
Subject: [PATCH] add-backward-analysis-capability
---
clang/lib/Analysis/Lifetim
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/148967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/148712
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148712
>From 7365fc44f79b49447f41771dcb9707150e1a4f90 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Mon, 14 Jul 2025 19:37:49 +
Subject: [PATCH] [LifetimeSafety] Add loan expiry analysis
---
clang/lib/Analysi
usx95 wrote:
### Merge activity
* **Jul 16, 2:12 PM UTC**: A user started a stack merge that includes this pull
request via
[Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/148222).
https://github.com/llvm/llvm-project/pull/148222
__
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From b7375fb1370a9e2903a53b629fc2dfd28b05dc45 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/3] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 927f92a13bfe02ca3e458723a0e74fe0b7f53d18 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/2] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 927f92a13bfe02ca3e458723a0e74fe0b7f53d18 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/2] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 2bff132be9082f85835f22e73550447f7b880e13 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH] [LifetimeSafety] Add expired loans analysis
---
clang/lib/Analy
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 5d10f007a81861e513c1483163947182b109c92d Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/3] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 2bff132be9082f85835f22e73550447f7b880e13 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/3] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 2bff132be9082f85835f22e73550447f7b880e13 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/2] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
usx95 wrote:
@sjoerdmeijer How are you running this ? This analysis is currently
experimental, hidden behind `-Wexperimental-lifetime-safety`.
https://github.com/llvm/llvm-project/pull/148222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ht
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/105817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/149592
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/149592
>From a3dc1471feb9e5b748c091779eed8c433eb6fd46 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 18 Jul 2025 21:19:50 +
Subject: [PATCH] add-frontend-option-for-lifetime-safety
---
clang/include/clang
https://github.com/usx95 ready_for_review
https://github.com/llvm/llvm-project/pull/149592
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
> I have narrowed it down to the usage of -Weverything.
> Is that intended behaviour, does -Wexperimental-lifetime-safety gets enabled
> by that?
Yes. I am trying to have a different option to enable this analysis other
instead of the warning -Wexperimental-lifetime-safety in
htt
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/149592
None
>From 104d600d138a1f66587978260db063cff292dd43 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 18 Jul 2025 21:19:50 +
Subject: [PATCH] add-frontend-option-for-lifetime-safety
---
clang/include
usx95 wrote:
* **#149592** https://app.graphite.dev/github/pr/llvm/llvm-project/149592?utm_source=stack-comment-icon";
target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite"
width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/149592
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/149592
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,13 @@
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIME_SAFETY_H
usx95 wrote:
Done. Thanks.
https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
@@ -0,0 +1,13 @@
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIME_SAFETY_H
usx95 wrote:
Done.
https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/147208
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,508 @@
+//===- LifetimeSafety.cpp - C++ Lifetime Safety Analysis -*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
https://github.com/usx95 commented:
> Something for future PRs: I think it would be nice to have some sort of
> coverage statistics. While initially you do not aim to cover all of C++, it
> would be good to know what portion of nodes are missing from the fact
> generation when we run this on s
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/147208
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/147208
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
In 1-2 days, I will go ahead and merge this if there are no more comments from
other reviewers. cc: @ymand
https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cg
usx95 wrote:
Sorry for the trouble. Thanks @Prabhuk and @dyung for spotting and fixing this!
https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148065
>From 123045c4db9ec6969fc111ab817b8f238d0ee23c Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 10 Jul 2025 22:00:01 +
Subject: [PATCH] [LifetimeSafety] Implement dataflow analysis for loan
propagatio
@@ -0,0 +1,504 @@
+//===- LifetimeSafety.cpp - C++ Lifetime Safety Analysis -*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,504 @@
+//===- LifetimeSafety.cpp - C++ Lifetime Safety Analysis -*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,504 @@
+//===- LifetimeSafety.cpp - C++ Lifetime Safety Analysis -*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,504 @@
+//===- LifetimeSafety.cpp - C++ Lifetime Safety Analysis -*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,504 @@
+//===- LifetimeSafety.cpp - C++ Lifetime Safety Analysis -*-
C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -493,7 +496,247 @@ class FactGenerator : public
ConstStmtVisitor {
};
// = //
-// TODO: Run dataflow analysis to propagate loans, analyse and error
reporting.
+// The Dat
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/148065
None
>From f6ca9022b136007bfbd369e71b4361829aeb89e0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 10 Jul 2025 22:00:01 +
Subject: [PATCH] [LifetimeSafety] Implement dataflow analysis for loan
prop
https://github.com/usx95 ready_for_review
https://github.com/llvm/llvm-project/pull/148065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
* **#148065** https://app.graphite.dev/github/pr/llvm/llvm-project/148065?utm_source=stack-comment-icon";
target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite"
width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/148065
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/148065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/142313
>From 0cd187b01e61b200d92ca0b640789c1586075142 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Mon, 2 Jun 2025 17:53:14 +
Subject: [PATCH 1/2] Introduce Intra-procedural lifetime analysis in Clang
---
..
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/142313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 converted_to_draft
https://github.com/llvm/llvm-project/pull/147208
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/142313
>From 0cd187b01e61b200d92ca0b640789c1586075142 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Mon, 2 Jun 2025 17:53:14 +
Subject: [PATCH 1/3] Introduce Intra-procedural lifetime analysis in Clang
---
..
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,753 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,753 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,728 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
@@ -0,0 +1,753 @@
+#include "clang/Analysis/Analyses/LifetimeSafety.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/Type.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#inc
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 80d6c7b536cff6d95416e70676c9b33e5d1e174a Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH] [LifetimeSafety] Add expired loans analysis
---
clang/lib/Analy
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148222
>From 80d6c7b536cff6d95416e70676c9b33e5d1e174a Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 11 Jul 2025 11:11:47 +
Subject: [PATCH 1/2] [LifetimeSafety] Add expired loans analysis
---
clang/lib/A
@@ -493,7 +496,241 @@ class FactGenerator : public
ConstStmtVisitor {
};
// = //
-// TODO: Run dataflow analysis to propagate loans, analyse and error
reporting.
+// The Dat
@@ -493,7 +496,241 @@ class FactGenerator : public
ConstStmtVisitor {
};
// = //
-// TODO: Run dataflow analysis to propagate loans, analyse and error
reporting.
+// The Dat
@@ -493,7 +496,241 @@ class FactGenerator : public
ConstStmtVisitor {
};
// = //
-// TODO: Run dataflow analysis to propagate loans, analyse and error
reporting.
+// The Dat
@@ -493,7 +496,247 @@ class FactGenerator : public
ConstStmtVisitor {
};
// = //
-// TODO: Run dataflow analysis to propagate loans, analyse and error
reporting.
+// The Dat
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/148065
>From 123045c4db9ec6969fc111ab817b8f238d0ee23c Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 10 Jul 2025 22:00:01 +
Subject: [PATCH 1/4] [LifetimeSafety] Implement dataflow analysis for loan
propag
@@ -174,6 +355,11 @@ void nested_scopes() {
// CHECK: Expire (LoanID: [[L_OUTER]])
}
+// CHECK-LABEL: Dataflow results:
+// CHECK-DAG: Origin [[O_P]] contains Loan [[L_INNER]]
usx95 wrote:
good point. Added.
https://github.com/llvm/llvm-project/pull/148065
1101 - 1200 of 1230 matches
Mail list logo