xref: /freebsd/contrib/llvm-project/libcxx/src/legacy_pointer_safety.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
2349cc55cSDimitry Andric //
3349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6349cc55cSDimitry Andric //
7349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
8349cc55cSDimitry Andric 
9*81ad6265SDimitry Andric #include <__config>
10349cc55cSDimitry Andric #include <memory>
11349cc55cSDimitry Andric 
12349cc55cSDimitry Andric // Support for garbage collection was removed in C++23 by https://wg21.link/P2186R2. Libc++ implements
13349cc55cSDimitry Andric // that removal as an extension in all Standard versions. However, we still define the functions that
14349cc55cSDimitry Andric // were once part of the library's ABI for backwards compatibility.
15349cc55cSDimitry Andric 
16349cc55cSDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
17349cc55cSDimitry Andric 
18349cc55cSDimitry Andric _LIBCPP_FUNC_VIS void declare_reachable(void*) {}
19349cc55cSDimitry Andric _LIBCPP_FUNC_VIS void declare_no_pointers(char*, size_t) {}
20349cc55cSDimitry Andric _LIBCPP_FUNC_VIS void undeclare_no_pointers(char*, size_t) {}
21349cc55cSDimitry Andric _LIBCPP_FUNC_VIS void* __undeclare_reachable(void* p) { return p; }
22349cc55cSDimitry Andric 
23349cc55cSDimitry Andric _LIBCPP_END_NAMESPACE_STD
24