Xazax-hun wrote:
> The problem was in if (C.wasInlined) logic in old version.
Thanks for elaborating! I think the idea was to have annotations all the way
down to syscalls, so if we end up inlining the body with the syscalls we still
get reasonable behavior.
Is the problem that some calls ca
Xazax-hun wrote:
> I thougth evalCall approach is more clean.
It is definitely more clean locally. My concerns is about the global behavior.
Imagine a function that deals with both Fuchsia handles and plain old C file
handles. If we start to do evalCall and no longer inline the body, we no lon
Xazax-hun wrote:
> I don't have strong opinion, I just want to fix annoying false positives with
> ctu =)
Thanks for working on this, I really appreciate it! :) I would even say this is
not related to ctu, because users could run into this behavior within a single
translation unit. I just wan
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/111006
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,217 @@
+//===- unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.cpp
==//
+//
+// 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/Xazax-hun commented:
Overall looks good to me but also wait for a review from the code owners.
https://github.com/llvm/llvm-project/pull/111006
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
Xazax-hun wrote:
I think APINotes support attributes on param declarations. That being said, I
think APINotes might need an extension to explicitly add support for handle
attributes. But I think that should be a straightforward patch.
https://github.com/llvm/llvm-project/pull/111588
_
https://github.com/Xazax-hun approved this pull request.
Some small nits inline, but it looks good to me.
https://github.com/llvm/llvm-project/pull/112047
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -107,6 +107,39 @@ namespace std {
using std::operator""s;
using std::operator""sv;
+namespace default_args {
+ using IntArray = int[];
+ const int *defaultparam1(const int &def1 [[clang::lifetimebound]] = 0); //
#def1
+ const int &defaultparam_array([[clang::lifetimebou
@@ -107,6 +107,39 @@ namespace std {
using std::operator""s;
using std::operator""sv;
+namespace default_args {
+ using IntArray = int[];
+ const int *defaultparam1(const int &def1 [[clang::lifetimebound]] = 0); //
#def1
Xazax-hun wrote:
Nit: not sure if t
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/112047
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -107,6 +107,39 @@ namespace std {
using std::operator""s;
using std::operator""sv;
+namespace default_args {
+ using IntArray = int[];
+ const int *defaultparam1(const int &def1 [[clang::lifetimebound]] = 0); //
#def1
+ const int &defaultparam_array([[clang::lifetimebou
Xazax-hun wrote:
I am really glad that there is a consensus on the behavior what we want and the
only contention is how would we get there.
It would be great to summarize the pros and cons of the two approaches, but
before someone is doing that I wanted to make it clear that I think some of th
Xazax-hun wrote:
Some random, unorganized questions:
* Any reasons we cannot make block counts available to bug reporters and get a
best of both worlds (relatively simple implementation and get the separation of
concerns)?
* Does any of the approaches have trouble dealing with short-circuiting
@@ -0,0 +1,199 @@
+//== BoundsInformationChecker.cpp - bounds information checker --*- 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,199 @@
+//== BoundsInformationChecker.cpp - bounds information checker --*- 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,199 @@
+//== BoundsInformationChecker.cpp - bounds information checker --*- 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/Xazax-hun commented:
Overall, the direction looks good to me, some nitpicky comments inline.
https://github.com/llvm/llvm-project/pull/112784
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/112784
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,199 @@
+//== BoundsInformationChecker.cpp - bounds information checker --*- 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
@@ -330,8 +330,8 @@ struct StatusOr {
};
void test(StatusOr foo1, StatusOr foo2) {
- foo1 = Foo(); // expected-warning {{object backing the pointer foo1 will be
destroyed at the end}}
- // No warning on non-gsl annotated types.
- foo2 = NonAnnotatedFoo();
+ foo1 = Foo();
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/113180
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/111737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun approved this pull request.
Looks good to me, some minor nits inline.
https://github.com/llvm/llvm-project/pull/38
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
@@ -797,6 +798,10 @@ RuntimeDefinition CXXInstanceCall::getRuntimeDefinition()
const {
return {};
}
+ const MemRegion *R = getCXXThisVal().getAsRegion();
+ DynamicTypeInfo DynType = getDynamicTypeInfo(getState(), R);
Xazax-hun wrote:
My understanding
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/38
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -748,6 +747,22 @@ SVal CXXInstanceCall::getCXXThisVal() const {
return ThisVal;
}
+const CXXRecordDecl *CXXInstanceCall::getDeclForDynamicType() const {
+ const MemRegion *R = getCXXThisVal().getAsRegion();
+ if (!R)
+return nullptr;
+
+ DynamicTypeInfo DynType = g
Xazax-hun wrote:
> The problem in our code is that function that releases a handle calls a
> syscall via macro, so it's not possible to directly annotate it.
Ah, I see! Thanks for sharing! I think there are a couple potential workarounds
here if you cannot change the macros:
* Use something l
https://github.com/Xazax-hun approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/114042
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Xazax-hun wrote:
Let's copy the relevant part from the other PR into the description of this one
to make it more self-contained.
https://github.com/llvm/llvm-project/pull/114044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.ll
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/114044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -780,3 +780,30 @@ void test13() {
}
} // namespace GH100526
+
+namespace test {
+
+struct [[gsl::Pointer]] FooOwner {};
+struct [[gsl::Pointer]] FooPointer {
+ FooPointer(const FooOwner&);
+};
+
+template
+struct [[gsl::Owner]] Container {
+ const T& get() const [[clang::
@@ -1094,6 +1094,24 @@ static bool pathOnlyHandlesGslPointer(IndirectLocalPath
&Path) {
return false;
}
+static bool
+isLifetimeboundInterleaveInGSL(llvm::ArrayRef PathRef)
{
Xazax-hun wrote:
I am just wondering if this is the right approach to filter thi
@@ -748,6 +747,22 @@ SVal CXXInstanceCall::getCXXThisVal() const {
return ThisVal;
}
+const CXXRecordDecl *CXXInstanceCall::getDeclForDynamicType() const {
+ const MemRegion *R = getCXXThisVal().getAsRegion();
+ if (!R)
+return nullptr;
+
+ DynamicTypeInfo DynType = g
https://github.com/Xazax-hun approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/38
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/114222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun commented:
Makes sense for me. It would be nice if we had a minimal reproducer for a
regression test instead of maintaining a large-ish test.
https://github.com/llvm/llvm-project/pull/114222
___
cfe-commits mailing list
cf
Xazax-hun wrote:
> To me, simplifying a SymbolRef should never result in Unknown or Undef,
> unless it was Unknown or Undef initially or, during simplification we
> realized that it's a division by zero once we did the constant folding, etc.
I understand that we might not be ready for this, bu
https://github.com/Xazax-hun created
https://github.com/llvm/llvm-project/pull/114830
This patch adds the ability to mark function and method parameters as
lifetimebound. Unfortunately, this does not support lifetimebound annotating
'this' (putting the annotation on the method type instead of
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/114830
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/114044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun approved this pull request.
Balázs has an incredible track record of quality contributions, code reviews,
RFCs. He has been instrumental to the success of the Clang Static Analyzer. I
wholeheartedly support adding him to the list of maintainers.
https://github.com
https://github.com/Xazax-hun created
https://github.com/llvm/llvm-project/pull/115021
This patch makes the position -1 interpreted as the position for 'this'. Adds
some basic infrastructure and support for lifetimebound attribute.
From 77fa0b631e8743385768f3eb9ee607e9d01e9736 Mon Sep 17 00:00:
https://github.com/Xazax-hun closed
https://github.com/llvm/llvm-project/pull/114830
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -444,6 +454,16 @@ class ParamInfo : public VariableInfo {
NoEscape = Value.value_or(false);
}
+ std::optional isLifetimebound() const {
+if (!LifetimeboundSpecified)
+ return std::nullopt;
+return Lifetimebound;
Xazax-hun wrote:
Ugh, so
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/114044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun commented:
Overall, this approach looks promising to me. Some nits inline.
https://github.com/llvm/llvm-project/pull/114044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
@@ -1093,6 +1093,87 @@ static bool pathOnlyHandlesGslPointer(const
IndirectLocalPath &Path) {
}
return false;
}
+// Result of analyzing the Path for GSLPointer.
+enum AnalysisResult {
Xazax-hun wrote:
Nit: not sure what is the current policy about `enum c
@@ -1093,6 +1093,87 @@ static bool pathOnlyHandlesGslPointer(const
IndirectLocalPath &Path) {
}
return false;
}
+// Result of analyzing the Path for GSLPointer.
+enum AnalysisResult {
+ // Path does not correspond to a GSLPointer.
+ NotGSLPointer,
+
+ // A relevant case
@@ -1093,6 +1093,87 @@ static bool pathOnlyHandlesGslPointer(const
IndirectLocalPath &Path) {
}
return false;
}
+// Result of analyzing the Path for GSLPointer.
Xazax-hun wrote:
Nit: maybe we want some line breaks here for better separation.
https://gith
https://github.com/Xazax-hun approved this pull request.
LG!
https://github.com/llvm/llvm-project/pull/114213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun closed
https://github.com/llvm/llvm-project/pull/108631
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Xazax-hun wrote:
> I think we don't have any mechanisms like these. This was just a theoretical
> comment if I understood it right.
Actually, both. Yes, we don't have many of these in the engine as of today, but
we do model some overflows in some checkers, like the bitwise shifts checker.
It
@@ -1094,6 +1094,24 @@ static bool pathOnlyHandlesGslPointer(IndirectLocalPath
&Path) {
return false;
}
+static bool
+isLifetimeboundInterleaveInGSL(llvm::ArrayRef PathRef)
{
Xazax-hun wrote:
> The Path is [GslPointerInit, Lifetimebound]
I was wondering
https://github.com/Xazax-hun closed
https://github.com/llvm/llvm-project/pull/115482
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1889,6 +1889,40 @@ 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
@@ -1199,6 +1213,17 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
break;
}
+case LK_LifetimeCapture: {
+ if (!MTE)
Xazax-hun wrote:
Ah, makes sense. I guess there is only one case when we could potentially get
away with this, when `a
@@ -3867,6 +3868,105 @@ static void handleCallbackAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
S.Context, AL, EncodingIndices.data(), EncodingIndices.size()));
}
+LifetimeCaptureByAttr *Sema::ParseLifetimeCaptureByAttr(const ParsedAttr &AL,
+
@@ -3967,6 +3967,69 @@ Attribute ``trivial_abi`` has no effect in the following
cases:
}];
}
+
+def LifetimeCaptureByDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``lifetime_capture_by(X)`` attribute on a function parameter or
implic
https://github.com/Xazax-hun 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/Xazax-hun approved this pull request.
Some nits inline, but overall looks good for me.
https://github.com/llvm/llvm-project/pull/111499
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -3967,6 +3967,69 @@ Attribute ``trivial_abi`` has no effect in the following
cases:
}];
}
+
+def LifetimeCaptureByDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``lifetime_capture_by(X)`` attribute on a function parameter or
implic
@@ -3967,6 +3967,69 @@ Attribute ``trivial_abi`` has no effect in the following
cases:
}];
}
+
+def LifetimeCaptureByDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``lifetime_capture_by(X)`` attribute on a function parameter or
implic
@@ -3967,6 +3967,69 @@ Attribute ``trivial_abi`` has no effect in the following
cases:
}];
}
+
+def LifetimeCaptureByDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``lifetime_capture_by(X)`` attribute on a function parameter or
implic
https://github.com/Xazax-hun 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/Xazax-hun closed
https://github.com/llvm/llvm-project/pull/115866
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3919,7 +3919,24 @@ static void HandleLifetimeCaptureByAttr(Sema &S, Decl *D,
void Sema::LazyProcessLifetimeCaptureByParams(FunctionDecl *FD) {
bool HasImplicitThisParam = isInstanceMethod(FD);
-
+ SmallVector Attrs;
+ for (ParmVarDecl *PVD : FD->parameters())
+if (
https://github.com/Xazax-hun updated
https://github.com/llvm/llvm-project/pull/115866
From cdb2a965d3aae112f6661ea80b62fdc25a7d3837 Mon Sep 17 00:00:00 2001
From: Gabor Horvath
Date: Tue, 12 Nov 2024 13:07:01 +
Subject: [PATCH] [clang][APINotes] Add support for the SwiftEscapable
attribute
@@ -1266,11 +1266,11 @@ class CommonTypeTableInfo
class TagTableInfo : public CommonTypeTableInfo {
public:
unsigned getUnversionedInfoSize(const TagInfo &TI) {
-return 2 + (TI.SwiftImportAs ? TI.SwiftImportAs->size() : 0) +
- 2 + (TI.SwiftRetainOp ? TI.SwiftRet
@@ -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
@@ -249,9 +254,10 @@ static void
visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path,
LocalVisitor Visit);
template static bool isRecordWithAttr(QualType Type) {
- if (auto *RD = Type->getAsCXXRecordDecl())
-re
@@ -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/Xazax-hun created
https://github.com/llvm/llvm-project/pull/115866
This is similar to SwiftCopyable. Also fix missing SwiftCopyable dump for
TagInfo.
From 70ebdd0a63397130e45b79b3c6096c1847c07110 Mon Sep 17 00:00:00 2001
From: Gabor Horvath
Date: Tue, 12 Nov 2024 13:07:01 +
@@ -601,17 +601,23 @@ void test() {
std::optional o4 = std::optional(s);
// FIXME: should work for assignment cases
- v1 = {std::string()};
- o1 = std::string();
+ v1 = {std::string()}; // expected-warning {{object backing the pointer}}
+ o1 = std::string(); // expect
Xazax-hun wrote:
I think the interesting template cases are like things like:
```
template struct S {
T foo();
};
S a;
S b;
void f() {
a.foo();
b.foo();
}
```
The question is, whether we actually have the type attributes where we expect
to have them, or do we lose them?
Hopefully @eric
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/108631
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7147,6 +7147,60 @@ static bool
HandleWebAssemblyFuncrefAttr(TypeProcessingState &State,
return false;
}
+static void HandleSwiftAttr(TypeProcessingState &State, TypeAttrLocation TAL,
+QualType &QT, ParsedAttr &PAttr) {
+ if (TAL == TAL_DeclN
@@ -6037,13 +6038,24 @@ class AttributedType : public Type, public
llvm::FoldingSetNode {
private:
friend class ASTContext; // ASTContext creates these
+ const Attr *Attribute;
+
QualType ModifiedType;
QualType EquivalentType;
AttributedType(QualType canon, attr
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/115336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12,6 +12,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
+#include "clang/AST/Attrs.inc"
Xazax-hun wrote:
Is this include intended?
https://github.com/llvm/llvm-project/pull/111499
___
cfe-co
@@ -1199,6 +1213,17 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
break;
}
+case LK_LifetimeCapture: {
+ if (!MTE)
Xazax-hun wrote:
Do we want to diagnose the following case:
```
std::set set;
void addToSet(std::string_view s [[clang:
@@ -45,10 +48,14 @@ enum LifetimeKind {
/// a default member initializer), the program is ill-formed.
LK_MemInitializer,
- /// The lifetime of a temporary bound to this entity probably ends too soon,
+ /// The lifetime of a temporary bound to this entity may end too soon
@@ -1873,6 +1873,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
@@ -1909,6 +1911,12 @@ void TypePrinter::printAttributedAfter(const
AttributedType *T,
OS << " [[clang::lifetimebound]]";
return;
}
+ if (T->getAttrKind() == attr::LifetimeCaptureBy) {
+// FIXME: Print the attribute arguments once we have a way to retrieve
thes
@@ -1873,6 +1873,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/Xazax-hun 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/Xazax-hun commented:
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 p
@@ -1873,6 +1873,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/Xazax-hun updated
https://github.com/llvm/llvm-project/pull/115021
From 81b8faed9e6da8d8a0cc9905d14716f4b2f09665 Mon Sep 17 00:00:00 2001
From: Gabor Horvath
Date: Tue, 5 Nov 2024 16:37:57 +
Subject: [PATCH] [clang] Support 'this' position for lifetimebound attribute
Thi
https://github.com/Xazax-hun updated
https://github.com/llvm/llvm-project/pull/115021
From 80aa4c2c5675e1de12fa4ee05c02355346e88c06 Mon Sep 17 00:00:00 2001
From: Gabor Horvath
Date: Tue, 5 Nov 2024 16:37:57 +
Subject: [PATCH] [clang] Support 'this' position for lifetimebound attribute
Thi
https://github.com/Xazax-hun updated
https://github.com/llvm/llvm-project/pull/115021
From 2c1b0358a5ebc65af8c4abc0720fc1febeb3109d Mon Sep 17 00:00:00 2001
From: Gabor Horvath
Date: Tue, 5 Nov 2024 16:37:57 +
Subject: [PATCH] [clang] Support 'this' position for lifetimebound attribute
Thi
https://github.com/Xazax-hun closed
https://github.com/llvm/llvm-project/pull/115021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Xazax-hun wrote:
Yup, feel free to merge it!
https://github.com/llvm/llvm-project/pull/112047
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun ready_for_review
https://github.com/llvm/llvm-project/pull/115021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun updated
https://github.com/llvm/llvm-project/pull/115021
From 3ef43fcbb6540b50ed0b41c68d6b26bb31cb1a68 Mon Sep 17 00:00:00 2001
From: Gabor Horvath
Date: Tue, 5 Nov 2024 16:37:57 +
Subject: [PATCH] [clang] Support 'this' position for lifetimebound attribute
Thi
@@ -730,7 +731,9 @@ class YAMLConverter {
}
}
- void convertParams(const ParamsSeq &Params, FunctionInfo &OutInfo) {
+ std::optional convertParams(const ParamsSeq &Params,
+ FunctionInfo &OutInfo) {
Xazax-hun wro
601 - 700 of 1011 matches
Mail list logo