Skip to content

Conversation

Lancern
Copy link
Member

@Lancern Lancern commented Dec 13, 2023

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

This PR addresses issue #75235.

This commit adds relative TableGen definitions to parse the
[[gnu::no_stack_protector]] attribute.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Dec 13, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 13, 2023

@llvm/pr-subscribers-clang

Author: Sirui Mu (Lancern)

Changes

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

This PR addresses issue #75235.


Full diff: https://github.com/llvm/llvm-project/pull/75289.diff

1 Files Affected:

  • (modified) clang/include/clang/Basic/Attr.td (+2-1)
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;

@inclyc inclyc linked an issue Dec 13, 2023 that may be closed by this pull request
Copy link
Member

@inclyc inclyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR contains functional change so please add test & assertions under clang/test

@inclyc inclyc merged commit 9d02770 into llvm:main Dec 14, 2023
@Lancern Lancern deleted the clang_gnu_no_stack_protector branch December 14, 2023 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[clang] [[gnu::no_stack_protector]] is not recognized
3 participants