This is an archive of the discontinued LLVM Phabricator instance.

[libc] Use LIBC_HAS_BUILTIN instead of __has_builtin directly.
ClosedPublic

Authored by mikhail.ramalho on Aug 18 2023, 2:32 PM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2023, 2:32 PM
Herald added a subscriber: asb. · View Herald Transcript
mikhail.ramalho requested review of this revision.Aug 18 2023, 2:32 PM

This is fine with me except for referring to gcc < 10. We do not officially support gcc < 12.2. This will not change unless of course someone comes in and first prepares the code base for gcc < 12.2, and then stands up a bot for it. I am not opposed to this change because we already have precedents in the code base checking for availability of __has_builtin. So, title your patch to something like, Use __has_builtin only if available.

libc/src/__support/CPP/type_traits.h
224

Use LIBC_HAS_BUILTIN instead of creating our own

sivachandra accepted this revision.Aug 18 2023, 3:04 PM
sivachandra retitled this revision from [libc] Fix compilation with gcc < 10 to [libc] Use LIBC_HAS_BUILTIN instead of __has_builtin directly..
sivachandra edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Aug 18 2023, 3:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 21 2023, 4:37 AM