Skip to content

Stop using __attribute__((retain)) in GCC builds #133793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion llvm/include/llvm/Support/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@
#define LLVM_ATTRIBUTE_USED
#endif

#if __has_attribute(retain)
// Only enabled for clang:
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587
// GCC may produce "warning: ‘retain’ attribute ignored" (despite
// __has_attribute(retain) being 1).
#if defined(__clang__) && __has_attribute(retain)
#define LLVM_ATTRIBUTE_RETAIN __attribute__((__retain__))
#else
#define LLVM_ATTRIBUTE_RETAIN
Expand Down
Loading