Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / include / __filesystem / perm_options.h
blob82b73a7f7724ccf58b4461ab5402608c83962582
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 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___FILESYSTEM_PERM_OPTIONS_H
11 #define _LIBCPP___FILESYSTEM_PERM_OPTIONS_H
13 #include <__availability>
14 #include <__config>
16 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17 # pragma GCC system_header
18 #endif
20 #ifndef _LIBCPP_CXX03_LANG
22 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
24 enum class perm_options : unsigned char {
25 replace = 1,
26 add = 2,
27 remove = 4,
28 nofollow = 8
31 _LIBCPP_INLINE_VISIBILITY
32 inline constexpr perm_options operator&(perm_options __lhs, perm_options __rhs) {
33 return static_cast<perm_options>(static_cast<unsigned>(__lhs) &
34 static_cast<unsigned>(__rhs));
37 _LIBCPP_INLINE_VISIBILITY
38 inline constexpr perm_options operator|(perm_options __lhs, perm_options __rhs) {
39 return static_cast<perm_options>(static_cast<unsigned>(__lhs) |
40 static_cast<unsigned>(__rhs));
43 _LIBCPP_INLINE_VISIBILITY
44 inline constexpr perm_options operator^(perm_options __lhs, perm_options __rhs) {
45 return static_cast<perm_options>(static_cast<unsigned>(__lhs) ^
46 static_cast<unsigned>(__rhs));
49 _LIBCPP_INLINE_VISIBILITY
50 inline constexpr perm_options operator~(perm_options __lhs) {
51 return static_cast<perm_options>(~static_cast<unsigned>(__lhs));
54 _LIBCPP_INLINE_VISIBILITY
55 inline perm_options& operator&=(perm_options& __lhs, perm_options __rhs) {
56 return __lhs = __lhs & __rhs;
59 _LIBCPP_INLINE_VISIBILITY
60 inline perm_options& operator|=(perm_options& __lhs, perm_options __rhs) {
61 return __lhs = __lhs | __rhs;
64 _LIBCPP_INLINE_VISIBILITY
65 inline perm_options& operator^=(perm_options& __lhs, perm_options __rhs) {
66 return __lhs = __lhs ^ __rhs;
69 _LIBCPP_END_NAMESPACE_FILESYSTEM
71 #endif // _LIBCPP_CXX03_LANG
73 #endif // _LIBCPP___FILESYSTEM_PERM_OPTIONS_H