This is an archive of the discontinued LLVM Phabricator instance.

[libc++][NFC] Remove __has_keyword
AbandonedPublic

Authored by philnik on Aug 17 2023, 1:49 PM.

Details

Reviewers
Mordante
Group Reviewers
Restricted Project
Commits
rGcd34e89cfabb: [libc++][NFC] Remove __has_keyword
Summary

has_keyword is almost not used anymore. There are only two cases. One can be replaced by has_builtin and the other seems entirely redundant, so we can remove the definition.

Diff Detail

Event Timeline

philnik created this revision.Aug 17 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2023, 1:49 PM
philnik requested review of this revision.Aug 17 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2023, 1:49 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante added inline comments.
libcxx/include/__config
1155

Why is this NFC?

philnik added inline comments.Aug 18 2023, 11:12 AM
libcxx/include/__config
1155

Because this is always false for GCC and always true for Clang.

Mordante accepted this revision.Aug 19 2023, 4:10 AM

LGTM!

This revision is now accepted and ready to land.Aug 19 2023, 4:10 AM
This revision was automatically updated to reflect the committed changes.
hubert.reinterpretcast added inline comments.
libcxx/include/__config
1155

This is not NFC: -std=gnu++98 -pedantic-errors has this evaluate to false for Clang.

https://godbolt.org/z/xsfvhEfz9

This causes #include <algorithm> to fail with -std=gnu++98 -pedantic-errors:

$ clang++ -xc++ -<<<'#include <algorithm>' -std=gnu++98 -pedantic-errors 2>&1 | sed 's#/.*/bin#/bin#;' | head -n 20
In file included from <stdin>:1:
In file included from /bin/../include/c++/v1/algorithm:1811:
In file included from /bin/../include/c++/v1/__algorithm/pstl_any_all_none_of.h:12:
In file included from /bin/../include/c++/v1/__algorithm/pstl_find.h:14:
In file included from /bin/../include/c++/v1/__algorithm/pstl_backend.h:12:
In file included from /bin/../include/c++/v1/__algorithm/pstl_backends/cpu_backend.h:49:
In file included from /bin/../include/c++/v1/__algorithm/pstl_backends/cpu_backends/any_of.h:15:
In file included from /bin/../include/c++/v1/__atomic/atomic.h:12:
In file included from /bin/../include/c++/v1/__atomic/atomic_base.h:12:
In file included from /bin/../include/c++/v1/__atomic/atomic_sync.h:12:
In file included from /bin/../include/c++/v1/__atomic/contention_t.h:12:
/bin/../include/c++/v1/__atomic/cxx_atomic_impl.h:816:28: error: no template named '__cxx_atomic_base_impl'
  816 |           typename _Base = __cxx_atomic_base_impl<_Tp> >
      |                            ^
In file included from <stdin>:1:
In file included from /bin/../include/c++/v1/algorithm:1811:
In file included from /bin/../include/c++/v1/__algorithm/pstl_any_all_none_of.h:12:
In file included from /bin/../include/c++/v1/__algorithm/pstl_find.h:14:
In file included from /bin/../include/c++/v1/__algorithm/pstl_backend.h:12:
In file included from /bin/../include/c++/v1/__algorithm/pstl_backends/cpu_backend.h:49:
Return:  0x00:0   Thu Sep  7 14:34:31 2023 EDT

I've reverted this patch to unblock the internal AIX buildbot.

Mordante reopened this revision.Sep 7 2023, 12:33 PM

I've reverted this patch to unblock the internal AIX buildbot.

Thanks! This should at least not be NFC. Since it breaks things I think we should abandon this patch.
At least the new information should be taken into account for the review.

This revision is now accepted and ready to land.Sep 7 2023, 12:33 PM
Mordante requested changes to this revision.Sep 7 2023, 12:33 PM
This revision now requires changes to proceed.Sep 7 2023, 12:33 PM
philnik abandoned this revision.Sep 11 2023, 12:25 PM