Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e78f53d

Browse files
authoredOct 23, 2024··
Reapply "[libc++][C++03] Copy the LLVM 19 headers (#108999)" (#112127)
This reverts commit 68c04b0. This disables the IWYU mapping that caused the failure, since the headers aren't reachable for now. This is the first part of the "Freezing C++03 headers" proposal explained in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319/58. This patch mechanically copies the headers as of the LLVM 19.1 release into a subdirectory of libc++ so that we can start using these headers when building in C++03 mode. We are going to be backporting important changes to that copy of the headers until the LLVM 21 release. After the LLVM 21 release, only critical bugfixes will be fixed in the C++03 copy of the headers. This patch only performs a copy of the headers -- these headers are still unused by the rest of the codebase.
1 parent c919970 commit e78f53d

File tree

1,020 files changed

+199790
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,020 files changed

+199790
-0
lines changed
 

‎libcxx/include/__cxx03/CMakeLists.txt

Lines changed: 1092 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// -*- C++ -*-
2+
//===----------------------------------------------------------------------===//
3+
//
4+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
// See https://llvm.org/LICENSE.txt for license information.
6+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef _LIBCPP___ALGORITHM_ADJACENT_FIND_H
11+
#define _LIBCPP___ALGORITHM_ADJACENT_FIND_H
12+
13+
#include <__algorithm/comp.h>
14+
#include <__algorithm/iterator_operations.h>
15+
#include <__config>
16+
#include <__iterator/iterator_traits.h>
17+
#include <__utility/move.h>
18+
19+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20+
# pragma GCC system_header
21+
#endif
22+
23+
_LIBCPP_PUSH_MACROS
24+
#include <__undef_macros>
25+
26+
_LIBCPP_BEGIN_NAMESPACE_STD
27+
28+
template <class _Iter, class _Sent, class _BinaryPredicate>
29+
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
30+
__adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
31+
if (__first == __last)
32+
return __first;
33+
_Iter __i = __first;
34+
while (++__i != __last) {
35+
if (__pred(*__first, *__i))
36+
return __first;
37+
__first = __i;
38+
}
39+
return __i;
40+
}
41+
42+
template <class _ForwardIterator, class _BinaryPredicate>
43+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
44+
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
45+
return std::__adjacent_find(std::move(__first), std::move(__last), __pred);
46+
}
47+
48+
template <class _ForwardIterator>
49+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
50+
adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
51+
return std::adjacent_find(std::move(__first), std::move(__last), __equal_to());
52+
}
53+
54+
_LIBCPP_END_NAMESPACE_STD
55+
56+
_LIBCPP_POP_MACROS
57+
58+
#endif // _LIBCPP___ALGORITHM_ADJACENT_FIND_H

0 commit comments

Comments
 (0)
Please sign in to comment.