https://github.com/Xazax-hun commented:
We already have some logic in the statement local analysis about when we
consider a gsl pointer to be a borrow from an owner and when we propagate the
underlying borrow. I wonder if it was possible to somehow factor that logic out
and reuse it instead of
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/156896
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/154009
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -570,6 +625,31 @@ class FactGenerator : public
ConstStmtVisitor {
return isPointerType(VD->getType());
}
+ /// Checks if a call-like expression creates a borrow by passing a value to a
+ /// reference parameter, creating an IssueFact if it does.
+ void handleFucnt
@@ -438,12 +452,31 @@ class FactGenerator : public
ConstStmtVisitor {
void VisitDeclStmt(const DeclStmt *DS) {
for (const Decl *D : DS->decls())
if (const auto *VD = dyn_cast(D))
-if (hasOrigin(VD->getType()))
+if (hasOrigin(VD))
if (cons
@@ -438,12 +452,31 @@ class FactGenerator : public
ConstStmtVisitor {
void VisitDeclStmt(const DeclStmt *DS) {
for (const Decl *D : DS->decls())
if (const auto *VD = dyn_cast(D))
-if (hasOrigin(VD->getType()))
+if (hasOrigin(VD))
if (cons
@@ -438,12 +452,31 @@ class FactGenerator : public
ConstStmtVisitor {
void VisitDeclStmt(const DeclStmt *DS) {
for (const Decl *D : DS->decls())
if (const auto *VD = dyn_cast(D))
-if (hasOrigin(VD->getType()))
+if (hasOrigin(VD))
if (cons
@@ -438,12 +452,31 @@ class FactGenerator : public
ConstStmtVisitor {
void VisitDeclStmt(const DeclStmt *DS) {
for (const Decl *D : DS->decls())
if (const auto *VD = dyn_cast(D))
-if (hasOrigin(VD->getType()))
+if (hasOrigin(VD))
if (cons
@@ -438,12 +452,31 @@ class FactGenerator : public
ConstStmtVisitor {
void VisitDeclStmt(const DeclStmt *DS) {
for (const Decl *D : DS->decls())
if (const auto *VD = dyn_cast(D))
-if (hasOrigin(VD->getType()))
+if (hasOrigin(VD))
if (cons
@@ -433,6 +433,31 @@ class FactGeneratorVisitor : public
ConstStmtVisitor {
void VisitDeclRefExpr(const DeclRefExpr *DRE) { handleUse(DRE); }
+ void VisitCXXConstructExpr(const CXXConstructExpr *CCE) {
+if (!isGslPointerType(CCE->getType()))
+ return;
+
+if (
@@ -556,8 +554,47 @@ class FactGeneratorVisitor : public
ConstStmtVisitor {
return false;
}
+ void handleAssignment(const Expr *LHSExpr, const Expr *RHSExpr) {
+// Find the underlying variable declaration for the left-hand side.
+if (const auto *DRE_LHS =
+
@@ -556,8 +554,47 @@ class FactGeneratorVisitor : public
ConstStmtVisitor {
return false;
}
+ void handleAssignment(const Expr *LHSExpr, const Expr *RHSExpr) {
+// Find the underlying variable declaration for the left-hand side.
+if (const auto *DRE_LHS =
+
@@ -556,8 +554,47 @@ class FactGeneratorVisitor : public
ConstStmtVisitor {
return false;
}
+ void handleAssignment(const Expr *LHSExpr, const Expr *RHSExpr) {
+// Find the underlying variable declaration for the left-hand side.
+if (const auto *DRE_LHS =
+
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/154316
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun commented:
Overall looks good, some small questions inline.
https://github.com/llvm/llvm-project/pull/154316
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/li
Xazax-hun wrote:
> I think the liveness analysis can be built on top of this.
I see! I was not sure what the layering would be. Makes sense to me.
https://github.com/llvm/llvm-project/pull/154316
___
llvm-branch-commits mailing list
llvm-branch-comm
https://github.com/Xazax-hun approved this pull request.
LG, this is also low risk and high value. Good candidate to backport. Thanks a
lot for cherry picking!
https://github.com/llvm/llvm-project/pull/154738
___
llvm-branch-commits mailing list
llvm-
Xazax-hun wrote:
Looks great, this is a low risk fix, good idea to backport.
https://github.com/llvm/llvm-project/pull/155284
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/155284
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -433,6 +433,31 @@ class FactGeneratorVisitor : public
ConstStmtVisitor {
void VisitDeclRefExpr(const DeclRefExpr *DRE) { handleUse(DRE); }
+ void VisitCXXConstructExpr(const CXXConstructExpr *CCE) {
+if (!isGslPointerType(CCE->getType()))
+ return;
+
+if (
@@ -521,8 +563,75 @@ class FactGeneratorVisitor : public
ConstStmtVisitor {
}
private:
+ static bool isGslPointerType(QualType QT) {
+if (const auto *RD = QT->getAsCXXRecordDecl()) {
+ // We need to check the template definition for specializations.
+ if (aut
Xazax-hun wrote:
Looks good to me. Are all of those crashes present in previously released
stable versions?
https://github.com/llvm/llvm-project/pull/154600
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/154600
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun commented:
> It is checked for use-after-free unless it is being written to.
I wonder if this is important if we end up using liveness analysis. I.e., I
believe the value we are overwriting is not live. So, in case we only warn for
the live usages, we get this chec
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/153951
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun commented:
I am wondering if this is the right approach. If everything works out well,
every time we call `Visit` on an expression, there should be a guarantee we
already visited all the subexpressions of it (modulo some corner cases with
short circuiting operators
https://github.com/Xazax-hun approved this pull request.
Once the comments are addressed it looks good to me.
https://github.com/llvm/llvm-project/pull/148712
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.o
@@ -828,9 +869,49 @@ void runLifetimeSafetyAnalysis(const DeclContext &DC,
const CFG &Cfg,
///blocks; only Decls are visible. Therefore, loans in a block that
///never reach an Origin associated with a Decl can be safely dropped by
///the analysis.
- Lifeti
@@ -828,9 +869,49 @@ void runLifetimeSafetyAnalysis(const DeclContext &DC,
const CFG &Cfg,
///blocks; only Decls are visible. Therefore, loans in a block that
///never reach an Origin associated with a Decl can be safely dropped by
///the analysis.
- Lifeti
@@ -828,9 +869,49 @@ void runLifetimeSafetyAnalysis(const DeclContext &DC,
const CFG &Cfg,
///blocks; only Decls are visible. Therefore, loans in a block that
///never reach an Origin associated with a Decl can be safely dropped by
///the analysis.
- Lifeti
@@ -17,14 +17,87 @@
//===--===//
#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_H
#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_H
-#include "clang/AST/DeclBase.h"
#include "clang/Analysis/AnalysisD
@@ -828,9 +869,49 @@ void runLifetimeSafetyAnalysis(const DeclContext &DC,
const CFG &Cfg,
///blocks; only Decls are visible. Therefore, loans in a block that
///never reach an Origin associated with a Decl can be safely dropped by
///the analysis.
- Lifeti
@@ -807,17 +838,27 @@ class LoanPropagationAnalysis
// - Modify origin liveness analysis to answer `bool isLive(Origin O, Point P)`
// - Using the above three to perform the final error reporting.
// = //
-
https://github.com/Xazax-hun approved this pull request.
Once the testing story is figured out this looks good to me.
https://github.com/llvm/llvm-project/pull/148712
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://list
@@ -778,6 +778,65 @@ class LoanPropagationAnalysis
}
};
+// = //
+// Expired Loans Analysis
+// = //
+
+///
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/148712
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/148967
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
It is great to have these tools checked in, thanks!
https://github.com/llvm/llvm-project/pull/147315
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.or
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/139909
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/139591
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/136589
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
Xazax-hun wrote:
I think there might have been some changes to the CFG that could potentially
effect CSA. But I don't think those are that important to mention here.
https://github.com/llvm/llvm-project/pull/124798
___
llvm-branch-commits mailing lis
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/124798
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/120437
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/120436
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -298,9 +299,12 @@ class SymbolVal : public NonLoc {
/// Value representing integer constant.
class ConcreteInt : public NonLoc {
public:
- explicit ConcreteInt(const llvm::APSInt &V) : NonLoc(ConcreteIntKind, &V) {}
+ explicit ConcreteInt(APSIntPtr V) : NonLoc(ConcreteIntK
@@ -298,9 +299,12 @@ class SymbolVal : public NonLoc {
/// Value representing integer constant.
class ConcreteInt : public NonLoc {
public:
- explicit ConcreteInt(const llvm::APSInt &V) : NonLoc(ConcreteIntKind, &V) {}
+ explicit ConcreteInt(APSIntPtr V) : NonLoc(ConcreteIntK
@@ -298,9 +299,12 @@ class SymbolVal : public NonLoc {
/// Value representing integer constant.
class ConcreteInt : public NonLoc {
public:
- explicit ConcreteInt(const llvm::APSInt &V) : NonLoc(ConcreteIntKind, &V) {}
+ explicit ConcreteInt(APSIntPtr V) : NonLoc(ConcreteIntK
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/120438
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -514,9 +514,12 @@ class MemRegionVal : public Loc {
class ConcreteInt : public Loc {
public:
- explicit ConcreteInt(const llvm::APSInt &V) : Loc(ConcreteIntKind, &V) {}
+ explicit ConcreteInt(APSIntPtr V) : Loc(ConcreteIntKind, V.get()) {}
Xazax-hun wrote
@@ -298,9 +299,12 @@ class SymbolVal : public NonLoc {
/// Value representing integer constant.
class ConcreteInt : public NonLoc {
public:
- explicit ConcreteInt(const llvm::APSInt &V) : NonLoc(ConcreteIntKind, &V) {}
+ explicit ConcreteInt(APSIntPtr V) : NonLoc(ConcreteIntK
https://github.com/Xazax-hun approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/107841
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
LGTM! We should avoid performance regressions and for some projects this could
be a serious one. I agree with backporting the workaround.
https://github.com/llvm/llvm-project/pull/105516
___
ll
https://github.com/Xazax-hun approved this pull request.
LGTM, it makes sense to me to backport this crash fix.
https://github.com/llvm/llvm-project/pull/101684
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.
https://github.com/Xazax-hun approved this pull request.
LGTM, makes sense to backport.
https://github.com/llvm/llvm-project/pull/101651
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/89725
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/81834
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/79997
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
58 matches
Mail list logo