mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-20 01:57:37 +00:00
[clang] Parse attribute [[gnu::no_stack_protector]] (#75289)
This commit adds relative TableGen definitions to parse the `[[gnu::no_stack_protector]]` attribute. This PR addresses issue #75235.
This commit is contained in:
parent
b07aaf8d3b
commit
9d02770832
@ -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;
|
||||
|
@ -1,4 +1,7 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 %s
|
||||
|
||||
[[gnu::no_stack_protector]] void test1(void) {}
|
||||
[[clang::no_stack_protector]] void test2(void) {}
|
||||
|
||||
void __attribute__((no_stack_protector)) foo(void) {}
|
||||
int __attribute__((no_stack_protector)) var; // expected-warning {{'no_stack_protector' attribute only applies to functions}}
|
||||
|
5
clang/test/Sema/no_stack_protector.cpp
Normal file
5
clang/test/Sema/no_stack_protector.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
[[gnu::no_stack_protector]] void test1() {}
|
||||
[[clang::no_stack_protector]] void test2() {}
|
Loading…
x
Reference in New Issue
Block a user