[clang] [clang] Parse attribute [[gnu::no_stack_protector]] (PR #75289)

Sirui Mu via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 22:57:11 PST 2023


https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/75289

This commit adds relative TableGen definitions to parse the [[gnu::no_stack_protector]] attribute.

This PR addresses issue #75235.

>From d8de529580101ba68dc1c981aec8711aa0c58da4 Mon Sep 17 00:00:00 2001
From: Sirui Mu <msrlancern at gmail.com>
Date: Wed, 13 Dec 2023 06:51:09 +0000
Subject: [PATCH] [clang] Parse attribute [[gnu::no_stack_protector]]

This commit adds relative TableGen definitions to parse the
[[gnu::no_stack_protector]] attribute.
---
 clang/include/clang/Basic/Attr.td | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 0d94ea2851c9ab..0344fa23e15369 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -2212,7 +2212,8 @@ def NotTailCalled : InheritableAttr {
 def : MutualExclusions<[AlwaysInline, NotTailCalled]>;
 
 def NoStackProtector : InheritableAttr {
-  let Spellings = [Clang<"no_stack_protector">, Declspec<"safebuffers">];
+  let Spellings = [Clang<"no_stack_protector">, CXX11<"gnu", "no_stack_protector">,
+                   C23<"gnu", "no_stack_protector">, Declspec<"safebuffers">];
   let Subjects = SubjectList<[Function]>;
   let Documentation = [NoStackProtectorDocs];
   let SimpleHandler = 1;



More information about the cfe-commits mailing list