@@ -6298,10 +6308,60 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 01/12] Initial implementation
---
.../bugprone/unchecked-option
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 01/11] Initial implementation
---
.../bugprone/unchecked-option
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 01/10] Initial implementation
---
.../bugprone/unchecked-option
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/9] Initial implementation
---
.../bugprone/unchecked-optional
@@ -3596,6 +3596,16 @@ bool FunctionDecl::isNoReturn() const {
return false;
}
+std::optional FunctionDecl::getAnalyzerNoReturn() const {
+ if (isNoReturn())
+return true;
+
+ if (auto *Attr = getAttr())
+return Attr->getValue();
+
+ return std::nullopt;
-
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/8] Initial implementation
---
.../bugprone/unchecked-optional
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/8] Initial implementation
---
.../bugprone/unchecked-optional
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/8] Initial implementation
---
.../bugprone/unchecked-optional
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/7] Initial implementation
---
.../bugprone/unchecked-optional
@@ -5950,14 +5950,15 @@ TEST(TransferTest,
ForStmtBranchWithoutConditionDoesNotExtendFlowCondition) {
Code,
[](const llvm::StringMap> &Results,
ASTContext &ASTCtx) {
-ASSERT_THAT(Results.keys(), UnorderedElementsAre("loop_body"));
+// targe
@@ -50,37 +50,45 @@ void NoReturnFunctionChecker::checkPostCall(const CallEvent
&CE,
BuildSinks = getFunctionExtInfo(C->getType()).getNoReturn();
}
- if (!BuildSinks && CE.isGlobalCFunction()) {
-if (const IdentifierInfo *II = CE.getCalleeIdentifier()) {
- /
https://github.com/negativ edited
https://github.com/llvm/llvm-project/pull/146355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/7] Initial implementation
---
.../bugprone/unchecked-optional
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/6] Initial implementation
---
.../bugprone/unchecked-optional
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
@@ -6298,10 +6334,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
@@ -2833,8 +2834,37 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C,
AddStmtChoice asc) {
if (!FD->isVariadic())
findConstructionContextsForArguments(C);
-if (FD->isNoReturn() || C->isBuiltinAssumeFalse(*Context))
- NoReturn = true;
+if (!NoReturn)
+
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/5] Initial implementation
---
.../bugprone/unchecked-optional
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/4] Initial implementation
---
.../bugprone/unchecked-optional
@@ -69,6 +69,22 @@ void
UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) {
cxxMethodDecl(unless(hasDescendant(cxxMemberCallExpr(callee(cxxMethodDecl(
hasName("operator="), ofClass(equalsBoundNode("class";
+ // Checking that some ki
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/7] Checking that some kind of constructor is called and
followe
@@ -69,6 +69,22 @@ void
UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) {
cxxMethodDecl(unless(hasDescendant(cxxMemberCallExpr(callee(cxxMethodDecl(
hasName("operator="), ofClass(equalsBoundNode("class";
+ // Checking that some ki
@@ -189,6 +189,12 @@ Changes in existing checks
calls of ``std::string`` constructor with char pointer, start position and
length parameters.
+- Improved :doc:`bugprone-unhandled-self-assignment
+ ` check by adding
+ an additional matcher that generalizes the copy-and-sw
@@ -189,6 +189,12 @@ Changes in existing checks
calls of ``std::string`` constructor with char pointer, start position and
length parameters.
+- Improved :doc:`bugprone-unhandled-self-assignment
negativ wrote:
@EugeneZelenko fixed
https://github.com/llvm
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/7] Checking that some kind of constructor is called and
followe
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/6] Checking that some kind of constructor is called and
followe
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/4] Initial implementation
---
.../bugprone/unchecked-optional
@@ -6298,10 +6334,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
https://github.com/negativ ready_for_review
https://github.com/llvm/llvm-project/pull/146355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/3] Initial implementation
---
.../bugprone/unchecked-optional
@@ -2835,8 +2835,37 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C,
AddStmtChoice asc) {
if (!FD->isVariadic())
findConstructionContextsForArguments(C);
-if (FD->isNoReturn() || C->isBuiltinAssumeFalse(*Context))
- NoReturn = true;
+if (!NoReturn)
+
https://github.com/negativ edited
https://github.com/llvm/llvm-project/pull/146355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ edited
https://github.com/llvm/llvm-project/pull/146355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ edited
https://github.com/llvm/llvm-project/pull/146355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/3] Initial implementation
---
.../bugprone/unchecked-optional
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/2] Initial implementation
---
.../bugprone/unchecked-optional
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/6] Checking that some kind of constructor is called and
followe
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/5] Checking that some kind of constructor is called and
followe
negativ wrote:
> Please mention changes in Release Notes.
@EugeneZelenko done.
https://github.com/llvm/llvm-project/pull/147066
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/4] Checking that some kind of constructor is called and
followe
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/4] Checking that some kind of constructor is called and
followe
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/147066
>From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Fri, 4 Jul 2025 17:13:20 +0300
Subject: [PATCH 1/3] Checking that some kind of constructor is called and
followe
https://github.com/negativ updated
https://github.com/llvm/llvm-project/pull/146355
>From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001
From: Andrey Karlov
Date: Mon, 30 Jun 2025 17:05:41 +0300
Subject: [PATCH 1/2] Initial implementation
---
.../bugprone/unchecked-optional
https://github.com/negativ ready_for_review
https://github.com/llvm/llvm-project/pull/147066
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ created
https://github.com/llvm/llvm-project/pull/147066
This change enhances the `bugprone-unhandled-self-assignment` checker by adding
an additional matcher that generalizes the copy-and-swap idiom pattern
detection.
# What Changed
Added a new matcher that checks
@@ -141,6 +141,42 @@ void
nullable_value_after_swap(BloombergLP::bdlb::NullableValue &opt1, Bloo
}
}
+void assertion_handler_imp() __attribute__((analyzer_noreturn));
+
+void assertion_handler() {
+do {
+ assertion_handler_imp();
+} while(0);
+}
+
+void functi
@@ -141,6 +141,42 @@ void
nullable_value_after_swap(BloombergLP::bdlb::NullableValue &opt1, Bloo
}
}
+void assertion_handler_imp() __attribute__((analyzer_noreturn));
+
+void assertion_handler() {
+do {
+ assertion_handler_imp();
+} while(0);
+}
+
+void functi
https://github.com/negativ edited
https://github.com/llvm/llvm-project/pull/146355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/negativ created
https://github.com/llvm/llvm-project/pull/146355
## Summary
This PR extends `Clang`'s `CFG` analysis to automatically propagate
`analyzer_noreturn` attributes through function call chains. When a function
exclusively calls no-return functions, it is automati
54 matches
Mail list logo