@@ -793,3 +806,202 @@ void test13() {
}
} // namespace GH100526
+
+namespace lifetime_capture_by {
+struct S {
+ const int *x;
+ void captureInt(const int&x [[clang::lifetime_capture_by(this)]]) { this->x
= &x; }
+ void captureSV(std::string_view sv [[clang::lifetime_captu
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/115921
>From 2cef37ecdb81452a8f5882dfe765167c1e45b7b6 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 13 Nov 2024 10:24:33 +
Subject: [PATCH 1/4] Implement semantics for lifetime analysis
---
clang/include
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/115921
>From 2cef37ecdb81452a8f5882dfe765167c1e45b7b6 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 13 Nov 2024 10:24:33 +
Subject: [PATCH 1/4] Implement semantics for lifetime analysis
---
clang/include
@@ -3229,6 +3231,52 @@ void Sema::CheckArgAlignment(SourceLocation Loc,
NamedDecl *FDecl,
<< ParamName << (FDecl != nullptr) << FDecl;
}
+void Sema::checkLifetimeCaptureBy(FunctionDecl *FD, bool IsMemberFunction,
+ const Expr *ThisArg,
@@ -1199,6 +1207,21 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
break;
}
+case LK_LifetimeCapture: {
+ if (!MTE)
+return false;
+ assert(shouldLifetimeExtendThroughPath(Path) ==
+ PathLifetimeKind::NoExtend &&
+
@@ -10132,10 +10132,10 @@ def err_lifetimebound_ctor_dtor : Error<
"%select{constructor|destructor}0">;
def err_lifetimebound_parameter_void_return_type : Error<
"'lifetimebound' attribute cannot be applied to a parameter of a function "
- "that returns void">;
+ "that re
@@ -1438,13 +1471,13 @@ void checkExprLifetime(Sema &SemaRef, const
InitializedEntity &Entity,
LifetimeKind LK = LTResult.getInt();
const InitializedEntity *ExtendingEntity = LTResult.getPointer();
checkExprLifetimeImpl(SemaRef, &Entity, ExtendingEntity, LK,
-
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/115921
>From 2cef37ecdb81452a8f5882dfe765167c1e45b7b6 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 13 Nov 2024 10:24:33 +
Subject: [PATCH 1/2] Implement semantics for lifetime analysis
---
clang/include
@@ -793,3 +793,108 @@ void test13() {
}
} // namespace GH100526
+
+namespace lifetime_capture_by {
+struct S {
+ const int *x;
+ void captureInt(const int&x [[clang::lifetime_capture_by(this)]]) { this->x
= &x; }
+ void captureSV(std::string_view sv [[clang::lifetime_captu
@@ -793,3 +793,108 @@ void test13() {
}
} // namespace GH100526
+
+namespace lifetime_capture_by {
+struct S {
+ const int *x;
+ void captureInt(const int&x [[clang::lifetime_capture_by(this)]]) { this->x
= &x; }
+ void captureSV(std::string_view sv [[clang::lifetime_captu
@@ -793,3 +793,108 @@ void test13() {
}
} // namespace GH100526
+
+namespace lifetime_capture_by {
+struct S {
+ const int *x;
+ void captureInt(const int&x [[clang::lifetime_capture_by(this)]]) { this->x
= &x; }
+ void captureSV(std::string_view sv [[clang::lifetime_captu
@@ -793,3 +793,108 @@ void test13() {
}
} // namespace GH100526
+
+namespace lifetime_capture_by {
+struct S {
+ const int *x;
+ void captureInt(const int&x [[clang::lifetime_capture_by(this)]]) { this->x
= &x; }
+ void captureSV(std::string_view sv [[clang::lifetime_captu
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/115921
>From 2cef37ecdb81452a8f5882dfe765167c1e45b7b6 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 13 Nov 2024 10:24:33 +
Subject: [PATCH 1/3] Implement semantics for lifetime analysis
---
clang/include
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/111499
>From 1aae3527ccba1eeaa8da4dd4309dcbdf590c4adf Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Sun, 3 Nov 2024 20:37:26 +0300
Subject: [PATCH] [MC] Make generated `MCInstPrinter::getMnemonic` const (NFC)
(
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/111499
>From fa191212f1d0e381503c250c3387e10a5f244576 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Sun, 10 Nov 2024 07:42:49 +
Subject: [PATCH] Introduce [[clang::lifetime_capture_by]]
---
clang/include/clan
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/111499
>From 1778769830af741684ae6ed0278f5ecc4626edae Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Sun, 10 Nov 2024 07:42:49 +
Subject: [PATCH] Introduce [[clang::lifetime_capture_by]]
---
clang/include/clan
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/111499
___
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/111499
>From b9379b1a8516fd8c2bb444aed09335eba37c8d53 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Sun, 10 Nov 2024 07:42:49 +
Subject: [PATCH] Introduce [[clang::lifetime_capture_by]]
---
clang/docs/Release
@@ -12,6 +12,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
+#include "clang/AST/Attrs.inc"
usx95 wrote:
Removed.
https://github.com/llvm/llvm-project/pull/111499
___
cfe-commits mailing list
cf
usx95 wrote:
The PR now only includes syntax changes without lifetime analysis. I will
address the unaddressed comments here related to analysis in subsequent PR.
https://github.com/llvm/llvm-project/pull/111499
___
cfe-commits mailing list
cfe-commit
@@ -1199,6 +1213,17 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
break;
}
+case LK_LifetimeCapture: {
+ if (!MTE)
usx95 wrote:
I don't think we can easily support this without intraprocedural data flow. For
example, consider the fol
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/111499
>From adaab9e5f549ae1625e8539334dfbc73a0559d8c Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Sun, 10 Nov 2024 07:42:49 +
Subject: [PATCH] Introduce [[clang::lifetime_capture_by]]
---
clang/docs/Release
https://github.com/usx95 ready_for_review
https://github.com/llvm/llvm-project/pull/111499
___
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/111499
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
> I did not get to the end of this PR yet, but I was wondering if it would make
> sense to split it up. One PR could add the attribute with the semantic
> analysis (e.g., warnings for ill-formed arguments). The second PR could
> introduce the lifetime analysis part. WDYT?
Makes s
@@ -1882,6 +1882,46 @@ def LifetimeBound : DeclOrTypeAttr {
let SimpleHandler = 1;
}
+def LifetimeCaptureBy : DeclOrTypeAttr {
+ let Spellings = [Clang<"lifetime_capture_by", 0>];
+ let Subjects = SubjectList<[ParmVar, ImplicitObjectParameter], ErrorDiag>;
+ let Args = [V
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/111499
>From 5af16e4afc15956dea0c46ffc3abb20067c047f2 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Sun, 10 Nov 2024 07:42:49 +
Subject: [PATCH] Introduce [[clang::lifetime_capture_by]]
---
clang/include/clan
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/111499
>From 83f0c8ff48ca1750048688eacc02bfffc52166b7 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Sun, 10 Nov 2024 07:42:49 +
Subject: [PATCH] Introduce [[clang::lifetime_capture_by]]
---
clang/docs/Release
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/115823
___
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/115823
>From 3c233df64906972016c26909263cfd53940d87a0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Tue, 12 Nov 2024 04:28:37 +
Subject: [PATCH 1/2] Reapply "[clang] Introduce
[[clang::lifetime_capture_by(X)]]
usx95 wrote:
Fixed the issues. Added more details in the description.
https://github.com/llvm/llvm-project/pull/115823
___
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/115823
>From 3c233df64906972016c26909263cfd53940d87a0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Tue, 12 Nov 2024 04:28:37 +
Subject: [PATCH 1/2] Reapply "[clang] Introduce
[[clang::lifetime_capture_by(X)]]
@@ -357,35 +369,101 @@ static bool shouldTrackFirstArgument(const FunctionDecl
*FD) {
return false;
}
+// Returns true if the given constructor is a copy-like constructor, such as
+// `Ctor(Owner&&)` or `Ctor(const Owner&)`.
+static bool isCopyLikeConstructor(const CXXConst
@@ -327,6 +369,103 @@ static bool shouldTrackFirstArgument(const FunctionDecl
*FD) {
return false;
}
+// Returns true if the given constructor is a copy-like constructor, such as
+// `Ctor(Owner&&)` or `Ctor(const Owner&)`.
+static bool isCopyLikeConstructor(const CXXConstr
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/108344
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -285,6 +285,18 @@ static bool isContainerOfPointer(const RecordDecl
*Container) {
}
return false;
}
+static bool isContainerOfOwner(const RecordDecl *Container) {
+ if (const auto *CTSD =
+ dyn_cast_if_present(Container)) {
usx95 wrote:
nit:
https://github.com/usx95 approved this pull request.
Thanks. LGTM.
https://github.com/llvm/llvm-project/pull/109653
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 approved this pull request.
Thanks. LGTM.
Left a comment to simplify the change.
https://github.com/llvm/llvm-project/pull/110247
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -704,6 +704,15 @@ ItaniumMangleContextImpl::getEffectiveDeclContext(const
Decl *D) {
return D->getLexicalDeclContext()->getRedeclContext();
}
+ if (const auto *FTD = dyn_cast(D)) {
+// Member-like constrained friends are mangled as if they were members of
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/110247
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -58,19 +58,19 @@ namespace test2 {
// CHECK: call {{.*}}@_ZN5test21AIiEF1fEzQ4TrueIT_E(
// CLANG17: call {{.*}}@_ZN5test21fEz(
f(ai);
-// CHECK: call {{.*}}@_ZN5test2F1gIvEEvzQaa4TrueIT_E4TrueITL0__E(
+// CHECK: call {{.*}}@_ZN5test21AIiEF1gIvEEvzQaa4True
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/110247
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2270,6 +2270,14 @@ void CXXNameMangler::mangleTemplatePrefix(GlobalDecl GD,
mangleTemplateParameter(TTP->getDepth(), TTP->getIndex());
} else {
const DeclContext *DC = Context.getEffectiveDeclContext(ND);
+if (const auto *FD = dyn_cast(GD.getDecl())) {
---
https://github.com/usx95 commented:
Thanks for catching and fixing this.
Please also add release notes in clang/docs/ReleaseNotes.rst
https://github.com/llvm/llvm-project/pull/110247
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://list
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/110503
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -704,6 +704,15 @@ ItaniumMangleContextImpl::getEffectiveDeclContext(const
Decl *D) {
return D->getLexicalDeclContext()->getRedeclContext();
}
+ if (const auto *FTD = dyn_cast(D)) {
+// Member-like constrained friends are mangled as if they were members of
+
https://github.com/usx95 commented:
Thanks. Left a comment about adding a FIXME to remove ABI compat checks and
figuring out the support for past ABI.
https://github.com/llvm/llvm-project/pull/110503
___
cfe-commits mailing list
cfe-commits@lists.llvm
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/110503
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -114,27 +134,42 @@ struct llvm::TimeTraceProfiler {
llvm::get_thread_name(ThreadName);
}
- TimeTraceProfilerEntry *begin(std::string Name,
-llvm::function_ref Detail,
-bool AsyncEvent = false) {
-Sta
@@ -145,27 +180,32 @@ struct llvm::TimeTraceProfiler {
DurationType Duration = E.End - E.Start;
// Only include sections longer or equal to TimeTraceGranularity msec.
-if (duration_cast(Duration).count() >= TimeTraceGranularity)
+if (duration_cast(Duration).cou
@@ -194,13 +234,17 @@ struct llvm::TimeTraceProfiler {
J.attribute("pid", Pid);
J.attribute("tid", int64_t(Tid));
J.attribute("ts", StartUs);
-if (E.AsyncEvent) {
+if (TimeTraceEventType::AsyncEvent == E.EventType) {
usx9
https://github.com/usx95 approved this pull request.
Thanks. Looks great now.
Should be ready to land. Left some nit comments.
https://github.com/llvm/llvm-project/pull/103039
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.
@@ -83,6 +83,19 @@ namespace llvm {
class raw_pwrite_stream;
+// Type of the time trace event.
+enum class TimeTraceEventType {
+ // Complete events have a duration (start and end time points) and are marked
+ // by the "X" phase type.
+ CompleteEvent,
usx
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/103039
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 approved this pull request.
Thanks. LGTM.
https://github.com/llvm/llvm-project/pull/110503
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -31,6 +32,11 @@ namespace usage_ok {
return *(int*)param;
}
+ template R dependent_void(const T& t
[[clang::lifetimebound]]);
+ void dependent_void_instantiation() {
+dependent_void(1);
usx95 wrote:
nit: add the following for completeness.
``
https://github.com/usx95 commented:
small nit for one more test.
https://github.com/llvm/llvm-project/pull/113460
___
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/113460
___
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/113460
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
For module related compilation issue: I added the reproducer here:
https://github.com/usx95/llvm-project/commit/8886dbecaf04f5c117e70d50e342bf264947cc64
Fails with:
```
sh module-reproducer/args.sh
In module 'libB':
module-reproducer/flume_test_utils.h:26:10: error: no viable conv
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/118078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 approved this pull request.
Thanks. LGTM.
https://github.com/llvm/llvm-project/pull/118078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -270,34 +270,49 @@ void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) {
}
void Sema::inferLifetimeCaptureByAttribute(FunctionDecl *FD) {
- if (!FD)
+ auto *MD = dyn_cast_if_present(FD);
+ if (!MD || !MD->getParent()->isInStdNamespace())
return;
- auto *MD = d
https://github.com/usx95 approved this pull request.
Thanks for quickly addressing this!
https://github.com/llvm/llvm-project/pull/118088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
@@ -258,9 +258,27 @@ template static bool
isRecordWithAttr(QualType Type) {
auto *RD = Type->getAsCXXRecordDecl();
if (!RD)
return false;
+ // Generally, if a primary template class declaration is annotated with an
+ // attribute, all its specializations generated f
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/118088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -366,3 +366,82 @@ void use() {
capture3(std::string(), x3); // expected-warning {{object whose reference is
captured by 'x3' will be destroyed at the end of the full-expression}}
}
} // namespace temporary_views
+
+// **
@@ -268,6 +268,40 @@ void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) {
}
}
+static bool IsPointerLikeType(QualType QT) {
+ QT = QT.getNonReferenceType();
+ if (QT->isPointerType())
+return true;
+ auto *RD = QT->getAsCXXRecordDecl();
+ if (!RD)
+return f
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/117315
None
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH] [clang] Check specialization for annotation
---
clang/lib
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117122
>From 9a57223b06a8331a0ef123739a430863dee19d98 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 21 Nov 2024 07:00:56 +
Subject: [PATCH 1/3] [clang] Infer lifetime_capture_by for STL containers
---
cl
@@ -268,6 +268,40 @@ void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) {
}
}
+static bool IsPointerLikeType(QualType QT) {
+ QT = QT.getNonReferenceType();
+ if (QT->isPointerType())
+return true;
+ auto *RD = QT->getAsCXXRecordDecl();
+ if (!RD)
+return f
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117122
___
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/117122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -268,6 +268,40 @@ void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) {
}
}
+static bool IsPointerLikeType(QualType QT) {
+ QT = QT.getNonReferenceType();
+ if (QT->isPointerType())
+return true;
+ auto *RD = QT->getAsCXXRecordDecl();
+ if (!RD)
+return f
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117122
___
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/117122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7,3 +7,106 @@ struct S {
};
// CHECK: CXXMethodDecl {{.*}}clang::lifetime_capture_by(a, b, global)
+
+//
+// Infer annotation for STL container methods.
+// ***
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117122
>From 9a57223b06a8331a0ef123739a430863dee19d98 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 21 Nov 2024 07:00:56 +
Subject: [PATCH 1/4] [clang] Infer lifetime_capture_by for STL containers
---
cl
@@ -7,3 +7,106 @@ struct S {
};
// CHECK: CXXMethodDecl {{.*}}clang::lifetime_capture_by(a, b, global)
+
+//
+// Infer annotation for STL container methods.
+// ***
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117122
>From 9a57223b06a8331a0ef123739a430863dee19d98 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 21 Nov 2024 07:00:56 +
Subject: [PATCH 1/2] [clang] Infer lifetime_capture_by for STL containers
---
cl
@@ -268,6 +268,40 @@ void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) {
}
}
+static bool IsPointerLikeType(QualType QT) {
+ QT = QT.getNonReferenceType();
+ if (QT->isPointerType())
+return true;
+ auto *RD = QT->getAsCXXRecordDecl();
+ if (!RD)
+return f
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7,3 +7,106 @@ struct S {
};
// CHECK: CXXMethodDecl {{.*}}clang::lifetime_capture_by(a, b, global)
+
+//
+// Infer annotation for STL container methods.
+// ***
usx95 wrote:
> We could potentially limit the suppression to cases where the destructor is
> trivial, but that might not be worth the added complexity.
I agree that might not be worth the complexity. Let's revisit if we have
practical false positives.
Thanks for the tests. LGTM.
https://gith
@@ -253,9 +253,12 @@ static void
visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path,
LocalVisitor Visit);
template static bool isRecordWithAttr(QualType Type) {
- if (auto *RD = Type->getAsCXXRecordDecl())
-re
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/4] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/5] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/8] [clang] Check specialization for annotation
---
clang/lib/S
@@ -1763,6 +1763,8 @@ class Sema final : public SemaBase {
/// Add [[gsl::Pointer]] attributes for std:: types.
void inferGslPointerAttribute(TypedefNameDecl *TD);
+ static bool isPointerLikeType(QualType QT);
usx95 wrote:
Added comments. Also moved to C
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/7] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117315
___
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/117315
___
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/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/3] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/117733
___
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/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/2] [clang] Check specialization for annotation
---
clang/lib/S
@@ -623,6 +623,26 @@ static void visitFunctionCallArguments(IndirectLocalPath
&Path, Expr *Call,
}
if (CheckCoroCall || Callee->getParamDecl(I)->hasAttr())
VisitLifetimeBoundArg(Callee->getParamDecl(I), Arg);
+else if (const auto *CaptureAttr =
+
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/117792
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -535,6 +535,9 @@ static void visitFunctionCallArguments(IndirectLocalPath
&Path, Expr *Call,
bool EnableGSLAnalysis = !Callee->getASTContext().getDiagnostics().isIgnored(
diag::warn_dangling_lifetime_pointer, SourceLocation());
+ bool EnableDanglingCapture =
+
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/6] [clang] Check specialization for annotation
---
clang/lib/S
usx95 wrote:
I considered this during implementation. This is a little controversial.
It is possible that the temporary capturing object uses the captured entity in
its destructor. In principle, we can always detect the order of destructions of
the temporaries and choose to suppress cases when
801 - 900 of 1079 matches
Mail list logo