https://github.com/danakj approved this pull request.
https://github.com/llvm/llvm-project/pull/116433
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2270,19 +2270,28 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
MsgParam = 5;
} else if (const auto *ECE = dyn_cast(Operation)) {
QualType destType = ECE->getType();
+bool destTypeComplete = true;
+
if (!isa(de
https://github.com/danakj approved this pull request.
https://github.com/llvm/llvm-project/pull/114857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3912,3 +3896,56 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
danakj wrote:
The suggested fixes were applied, thanks for them. It was a bit of work to page
all this back in after a while.
https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 9c0a0ca3f0bcf4910592dca2b7b9d7d9b83f6cee Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/5] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 9c0a0ca3f0bcf4910592dca2b7b9d7d9b83f6cee Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/5] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 9c0a0ca3f0bcf4910592dca2b7b9d7d9b83f6cee Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/4] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
danakj wrote:
Sorry I just haven't gotten back to making the fixes yet. If someone else wants
to apply them and land it I won't be upset, otherwise I will get to this
eventually..
https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailin
danakj wrote:
`#include` and `#define` at a minimum should break the connection. Comments
above a `#define` can be attributed to the macro defined there, which is
something that Subdoc does (example result:
https://suslib.cc/macro.sus_check.html)
https://github.com/llvm/llvm-project/pull/8836
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 273f93fa4aecc0017b5c7172bc296ced1bc6d5f5 Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/4] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 273f93fa4aecc0017b5c7172bc296ced1bc6d5f5 Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/4] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 273f93fa4aecc0017b5c7172bc296ced1bc6d5f5 Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/3] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
https://github.com/danakj edited https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
danakj wrote:
bump for review?
https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 273f93fa4aecc0017b5c7172bc296ced1bc6d5f5 Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/2] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 273f93fa4aecc0017b5c7172bc296ced1bc6d5f5 Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/2] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
danakj wrote:
I have rebased (which dropped the previous PR's commits) and applied the
requested changes in a second commit. I also fixed the test failures in that
second commit.
https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 273f93fa4aecc0017b5c7172bc296ced1bc6d5f5 Mon Sep 17 00:00:00 2001
From: danakj
Date: Mon, 13 May 2024 12:11:41 -0400
Subject: [PATCH 1/2] Generate -Wunsafe-buffer-usage warnings in ctor and field
initialize
https://github.com/danakj edited https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/danakj edited https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/danakj edited https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
}
}
}
+
+void clang::checkUnsafeBufferUsage(const Decl *D,
+ UnsafeBufferUsageHandler &Handler,
+ bool EmitSuggestions) {
+#ifndef
danakj wrote:
Thanks, this is very good
https://github.com/llvm/llvm-project/pull/93077
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/danakj closed https://github.com/llvm/llvm-project/pull/91777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danakj wrote:
Thanks for the explanation :)
https://github.com/llvm/llvm-project/pull/92031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1315,9 +1374,9 @@ class DerefSimplePtrArithFixableGadget : public
FixableGadget {
virtual std::optional
getFixits(const FixitStrategy &s) const final;
-
- // TODO remove this method from FixableGadget interface
danakj wrote:
Also it's slightly diffe
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91777
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH 1/4] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructor
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91777
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH 1/4] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructor
@@ -2856,7 +2916,7 @@ getFixIts(FixableGadgetSets &FixablesForAllVars, const
FixitStrategy &S,
}
#ifndef NDEBUG
Handler.addDebugNoteForVar(
- VD, F->getBaseStmt()->getBeginLoc(),
+ VD, F->getSourceLoc(),
danakj wrote:
I will leav
@@ -1315,9 +1374,9 @@ class DerefSimplePtrArithFixableGadget : public
FixableGadget {
virtual std::optional
getFixits(const FixitStrategy &s) const final;
-
- // TODO remove this method from FixableGadget interface
danakj wrote:
This one used to return
danakj wrote:
I am curious so I will ask: why did this take an approach of serializing the
output of the pragmas (the maps) instead of serializing the pragmas themselves
as AST nodes, so that the maps would be constructed in the same way as from
parsing the text directly? that's how other prag
@@ -921,10 +937,55 @@ class UnsafeBufferUsageAttrGadget : public WarningGadget {
}
static Matcher matcher() {
-return
stmt(callExpr(callee(functionDecl(hasAttr(attr::UnsafeBufferUsage
-.bind(OpTag));
+auto HasUnsafeFnDecl =
+callee(
@@ -2856,7 +2916,7 @@ getFixIts(FixableGadgetSets &FixablesForAllVars, const
FixitStrategy &S,
}
#ifndef NDEBUG
Handler.addDebugNoteForVar(
- VD, F->getBaseStmt()->getBeginLoc(),
+ VD, F->getSourceLoc(),
danakj wrote:
Yeah, this
@@ -2295,6 +2292,23 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
}
}
+ void handleUnsafeOperationInContainer(const Stmt *Operation,
+bool IsRelatedToDecl,
+ASTCont
danakj wrote:
> > https://github.com/llvm/llvm-project/blob/2ff43ce87e66d9324370e35ea6743ef57400c76e/clang/lib/Analysis/UnsafeBufferUsage.cpp#L1373-L1374
> >
> > These assert that exactly one gadget matched. I think it's kinda worthwhile
> > keeping the warnings independent too, so I don't see
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91777
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH 1/3] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructor
danakj wrote:
These lit test failures are indeed from this PR's last commit, I will dig into
why and correct what's wrong.
https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/c
danakj wrote:
> Hi! Thank you for digging into this! Sorry for the delay.
>
> > The new UnsafeBufferUsageCtorAttrGadget gadget explicitly avoids matching
> > against the std::span(ptr, size) constructor because that is handled by
> > SpanTwoParamConstructorGadget and we never want two gadgets
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH 1/3] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructor
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH 1/3] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructor
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91991
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH 1/3] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructor
https://github.com/danakj edited https://github.com/llvm/llvm-project/pull/91991
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/danakj edited https://github.com/llvm/llvm-project/pull/91777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/danakj created
https://github.com/llvm/llvm-project/pull/91991
This is built on top of https://github.com/llvm/llvm-project/pull/91777, and
includes the commits there for now.
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91777
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH 1/2] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructor
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91777
>From 8b318dadac6d0ec53b5d26461edfe19a391845ec Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructors
T
https://github.com/danakj updated
https://github.com/llvm/llvm-project/pull/91777
>From 1c835f4cc77823360762b8e53e2bbfe027c977cf Mon Sep 17 00:00:00 2001
From: danakj
Date: Fri, 10 May 2024 13:31:17 -0400
Subject: [PATCH] Respect the [[clang::unsafe_buffer_usage]] attribute for
constructors
T
danakj wrote:
cc: @haoNoQ
https://github.com/llvm/llvm-project/pull/91777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/danakj created
https://github.com/llvm/llvm-project/pull/91777
The -Wunsafe-buffer-usage warning should fire on any call to a function
annotated with [[clang::unsafe_buffer_usage]], however it omitted calls to
constructors, since the expression is a CXXConstructExpr which do
danakj wrote:
The subspace library also provides mechanisms [for
querying](https://suslib.cc/sus-mem-TriviallyRelocatable.html) and marking
types trivially relocatable, and relies on the compiler's
`__is_trivially_relocatable` as a signal as well. It then optimizes containers
and operations i
danakj wrote:
oh hey, just stumbled on this, thanks for improving it!
https://github.com/llvm/llvm-project/pull/65481
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danakj wrote:
I was just lamenting the lack of this feature this week. Thank you, I can’t
wait to use it.
https://github.com/llvm/llvm-project/pull/67613
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
63 matches
Mail list logo