[flang][openacc] Keep CYCLE check for compute and data construct (#73897)
[llvm-project.git] / libcxxabi / src / cxa_guard.cpp
blob514fa962e3daa8364beced766a3bde5117f4be37
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "__cxxabi_config.h"
10 #include "cxxabi.h"
12 // Tell the implementation that we're building the actual implementation
13 // (and not testing it)
14 #define BUILDING_CXA_GUARD
15 #include "cxa_guard_impl.h"
18 This implementation must be careful to not call code external to this file
19 which will turn around and try to call __cxa_guard_acquire reentrantly.
20 For this reason, the headers of this file are as restricted as possible.
21 Previous implementations of this code for __APPLE__ have used
22 std::__libcpp_mutex_lock and the abort_message utility without problem. This
23 implementation also uses std::__libcpp_condvar_wait which has tested
24 to not be a problem.
27 namespace __cxxabiv1 {
29 #if defined(_LIBCXXABI_GUARD_ABI_ARM)
30 using guard_type = uint32_t;
31 #else
32 using guard_type = uint64_t;
33 #endif
35 extern "C"
37 _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type* raw_guard_object) {
38 SelectedImplementation imp(raw_guard_object);
39 return static_cast<int>(imp.cxa_guard_acquire());
42 _LIBCXXABI_FUNC_VIS void __cxa_guard_release(guard_type *raw_guard_object) {
43 SelectedImplementation imp(raw_guard_object);
44 imp.cxa_guard_release();
47 _LIBCXXABI_FUNC_VIS void __cxa_guard_abort(guard_type *raw_guard_object) {
48 SelectedImplementation imp(raw_guard_object);
49 imp.cxa_guard_abort();
51 } // extern "C"
53 } // __cxxabiv1