Coverage Report

Created: 2018-09-25 17:16

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/BitmaskEnum.h
Line
Count
Source
1
//===-- llvm/ADT/BitmaskEnum.h ----------------------------------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_ADT_BITMASKENUM_H
11
#define LLVM_ADT_BITMASKENUM_H
12
13
#include <cassert>
14
#include <type_traits>
15
#include <utility>
16
17
#include "llvm/Support/MathExtras.h"
18
19
/// LLVM_MARK_AS_BITMASK_ENUM lets you opt in an individual enum type so you can
20
/// perform bitwise operations on it without putting static_cast everywhere.
21
///
22
/// \code
23
///   enum MyEnum {
24
///     E1 = 1, E2 = 2, E3 = 4, E4 = 8,
25
///     LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ E4)
26
///   };
27
///
28
///   void Foo() {
29
///     MyEnum A = (E1 | E2) & E3 ^ ~E4; // Look, ma: No static_cast!
30
///   }
31
/// \endcode
32
///
33
/// Normally when you do a bitwise operation on an enum value, you get back an
34
/// instance of the underlying type (e.g. int).  But using this macro, bitwise
35
/// ops on your enum will return you back instances of the enum.  This is
36
/// particularly useful for enums which represent a combination of flags.
37
///
38
/// The parameter to LLVM_MARK_AS_BITMASK_ENUM should be the largest individual
39
/// value in your enum.
40
///
41
/// All of the enum's values must be non-negative.
42
#define LLVM_MARK_AS_BITMASK_ENUM(LargestValue)                                \
43
  LLVM_BITMASK_LARGEST_ENUMERATOR = LargestValue
44
45
/// LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE() pulls the operator overloads used
46
/// by LLVM_MARK_AS_BITMASK_ENUM into the current namespace.
47
///
48
/// Suppose you have an enum foo::bar::MyEnum.  Before using
49
/// LLVM_MARK_AS_BITMASK_ENUM on MyEnum, you must put
50
/// LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE() somewhere inside namespace foo or
51
/// namespace foo::bar.  This allows the relevant operator overloads to be found
52
/// by ADL.
53
///
54
/// You don't need to use this macro in namespace llvm; it's done at the bottom
55
/// of this file.
56
#define LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()                               \
57
  using ::llvm::BitmaskEnumDetail::operator~;                                  \
58
  using ::llvm::BitmaskEnumDetail::operator|;                                  \
59
  using ::llvm::BitmaskEnumDetail::operator&;                                  \
60
  using ::llvm::BitmaskEnumDetail::operator^;                                  \
61
  using ::llvm::BitmaskEnumDetail::operator|=;                                 \
62
  using ::llvm::BitmaskEnumDetail::operator&=;                                 \
63
  /* Force a semicolon at the end of this macro. */                            \
64
  using ::llvm::BitmaskEnumDetail::operator^=
65
66
namespace llvm {
67
68
/// Traits class to determine whether an enum has a
69
/// LLVM_BITMASK_LARGEST_ENUMERATOR enumerator.
70
template <typename E, typename Enable = void>
71
struct is_bitmask_enum : std::false_type {};
72
73
template <typename E>
74
struct is_bitmask_enum<
75
    E, typename std::enable_if<sizeof(E::LLVM_BITMASK_LARGEST_ENUMERATOR) >=
76
                               0>::type> : std::true_type {};
77
namespace BitmaskEnumDetail {
78
79
/// Get a bitmask with 1s in all places up to the high-order bit of E's largest
80
/// value.
81
37.0k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
37.0k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
37.0k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
37.0k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
37.0k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
37.0k
         1;
87
37.0k
}
std::__1::underlying_type<llvm::MachineMemOperand::Flags>::type llvm::BitmaskEnumDetail::Mask<llvm::MachineMemOperand::Flags>()
Line
Count
Source
81
25.9k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
25.9k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
25.9k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
25.9k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
25.9k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
25.9k
         1;
87
25.9k
}
std::__1::underlying_type<llvm::DINode::DIFlags>::type llvm::BitmaskEnumDetail::Mask<llvm::DINode::DIFlags>()
Line
Count
Source
81
10.2k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
10.2k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
10.2k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
10.2k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
10.2k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
10.2k
         1;
87
10.2k
}
CGOpenMPRuntime.cpp:std::__1::underlying_type<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags>::type llvm::BitmaskEnumDetail::Mask<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags>()
Line
Count
Source
81
844
template <typename E> typename std::underlying_type<E>::type Mask() {
82
844
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
844
  // subtracting 1 gives us the mask with all bits set, like we want.
84
844
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
844
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
844
         1;
87
844
}
88
89
/// Check that Val is in range for E, and return Val cast to E's underlying
90
/// type.
91
309M
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
309M
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
309M
  assert(U >= 0 && "Negative enum values are not allowed.");
94
309M
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
309M
  return U;
96
309M
}
std::__1::underlying_type<llvm::MachineMemOperand::Flags>::type llvm::BitmaskEnumDetail::Underlying<llvm::MachineMemOperand::Flags>(llvm::MachineMemOperand::Flags)
Line
Count
Source
91
307M
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
307M
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
307M
  assert(U >= 0 && "Negative enum values are not allowed.");
94
307M
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
307M
  return U;
96
307M
}
std::__1::underlying_type<llvm::BinaryStreamFlags>::type llvm::BitmaskEnumDetail::Underlying<llvm::BinaryStreamFlags>(llvm::BinaryStreamFlags)
Line
Count
Source
91
408k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
408k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
408k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
408k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
408k
  return U;
96
408k
}
std::__1::underlying_type<llvm::DINode::DIFlags>::type llvm::BitmaskEnumDetail::Underlying<llvm::DINode::DIFlags>(llvm::DINode::DIFlags)
Line
Count
Source
91
964k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
964k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
964k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
964k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
964k
  return U;
96
964k
}
SIMemoryLegalizer.cpp:std::__1::underlying_type<(anonymous namespace)::SIAtomicAddrSpace>::type llvm::BitmaskEnumDetail::Underlying<(anonymous namespace)::SIAtomicAddrSpace>((anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
91
119k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
119k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
119k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
119k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
119k
  return U;
96
119k
}
SIMemoryLegalizer.cpp:std::__1::underlying_type<(anonymous namespace)::SIMemOp>::type llvm::BitmaskEnumDetail::Underlying<(anonymous namespace)::SIMemOp>((anonymous namespace)::SIMemOp)
Line
Count
Source
91
2.69k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
2.69k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
2.69k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
2.69k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
2.69k
  return U;
96
2.69k
}
CGOpenMPRuntime.cpp:std::__1::underlying_type<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags>::type llvm::BitmaskEnumDetail::Underlying<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags>((anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags)
Line
Count
Source
91
41.7k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
41.7k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
41.7k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
41.7k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
41.7k
  return U;
96
41.7k
}
std::__1::underlying_type<clang::Parser::AngleBracketTracker::Priority>::type llvm::BitmaskEnumDetail::Underlying<clang::Parser::AngleBracketTracker::Priority>(clang::Parser::AngleBracketTracker::Priority)
Line
Count
Source
91
462k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
462k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
462k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
462k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
462k
  return U;
96
462k
}
std::__1::underlying_type<llvm::pdb::PdbSymbolIdField>::type llvm::BitmaskEnumDetail::Underlying<llvm::pdb::PdbSymbolIdField>(llvm::pdb::PdbSymbolIdField)
Line
Count
Source
91
2.65k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
2.65k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
2.65k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
2.65k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
2.65k
  return U;
96
2.65k
}
std::__1::underlying_type<llvm::pdb::PdbRaw_Features>::type llvm::BitmaskEnumDetail::Underlying<llvm::pdb::PdbRaw_Features>(llvm::pdb::PdbRaw_Features)
Line
Count
Source
91
326
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
326
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
326
  assert(U >= 0 && "Negative enum values are not allowed.");
94
326
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
326
  return U;
96
326
}
97
98
template <typename E,
99
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
100
37.0k
E operator~(E Val) {
101
37.0k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
37.0k
}
llvm::MachineMemOperand::Flags llvm::BitmaskEnumDetail::operator~<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags)
Line
Count
Source
100
25.9k
E operator~(E Val) {
101
25.9k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
25.9k
}
llvm::DINode::DIFlags llvm::BitmaskEnumDetail::operator~<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags)
Line
Count
Source
100
10.2k
E operator~(E Val) {
101
10.2k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
10.2k
}
CGOpenMPRuntime.cpp:(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags llvm::BitmaskEnumDetail::operator~<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, void>((anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags)
Line
Count
Source
100
844
E operator~(E Val) {
101
844
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
844
}
103
104
template <typename E,
105
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
106
8.40M
E operator|(E LHS, E RHS) {
107
8.40M
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
8.40M
}
llvm::MachineMemOperand::Flags llvm::BitmaskEnumDetail::operator|<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags, llvm::MachineMemOperand::Flags)
Line
Count
Source
106
7.94M
E operator|(E LHS, E RHS) {
107
7.94M
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
7.94M
}
llvm::BinaryStreamFlags llvm::BitmaskEnumDetail::operator|<llvm::BinaryStreamFlags, void>(llvm::BinaryStreamFlags, llvm::BinaryStreamFlags)
Line
Count
Source
106
36.3k
E operator|(E LHS, E RHS) {
107
36.3k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
36.3k
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIAtomicAddrSpace llvm::BitmaskEnumDetail::operator|<(anonymous namespace)::SIAtomicAddrSpace, void>((anonymous namespace)::SIAtomicAddrSpace, (anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
106
47.6k
E operator|(E LHS, E RHS) {
107
47.6k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
47.6k
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIMemOp llvm::BitmaskEnumDetail::operator|<(anonymous namespace)::SIMemOp, void>((anonymous namespace)::SIMemOp, (anonymous namespace)::SIMemOp)
Line
Count
Source
106
1.34k
E operator|(E LHS, E RHS) {
107
1.34k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
1.34k
}
llvm::DINode::DIFlags llvm::BitmaskEnumDetail::operator|<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags, llvm::DINode::DIFlags)
Line
Count
Source
106
127k
E operator|(E LHS, E RHS) {
107
127k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
127k
}
CGOpenMPRuntime.cpp:(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags llvm::BitmaskEnumDetail::operator|<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, void>((anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, (anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags)
Line
Count
Source
106
19.0k
E operator|(E LHS, E RHS) {
107
19.0k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
19.0k
}
clang::Parser::AngleBracketTracker::Priority llvm::BitmaskEnumDetail::operator|<clang::Parser::AngleBracketTracker::Priority, void>(clang::Parser::AngleBracketTracker::Priority, clang::Parser::AngleBracketTracker::Priority)
Line
Count
Source
106
231k
E operator|(E LHS, E RHS) {
107
231k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
231k
}
llvm::pdb::PdbRaw_Features llvm::BitmaskEnumDetail::operator|<llvm::pdb::PdbRaw_Features, void>(llvm::pdb::PdbRaw_Features, llvm::pdb::PdbRaw_Features)
Line
Count
Source
106
69
E operator|(E LHS, E RHS) {
107
69
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
69
}
109
110
template <typename E,
111
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
112
146M
E operator&(E LHS, E RHS) {
113
146M
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
146M
}
llvm::MachineMemOperand::Flags llvm::BitmaskEnumDetail::operator&<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags, llvm::MachineMemOperand::Flags)
Line
Count
Source
112
145M
E operator&(E LHS, E RHS) {
113
145M
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
145M
}
llvm::BinaryStreamFlags llvm::BitmaskEnumDetail::operator&<llvm::BinaryStreamFlags, void>(llvm::BinaryStreamFlags, llvm::BinaryStreamFlags)
Line
Count
Source
112
167k
E operator&(E LHS, E RHS) {
113
167k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
167k
}
llvm::DINode::DIFlags llvm::BitmaskEnumDetail::operator&<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags, llvm::DINode::DIFlags)
Line
Count
Source
112
350k
E operator&(E LHS, E RHS) {
113
350k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
350k
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIAtomicAddrSpace llvm::BitmaskEnumDetail::operator&<(anonymous namespace)::SIAtomicAddrSpace, void>((anonymous namespace)::SIAtomicAddrSpace, (anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
112
11.9k
E operator&(E LHS, E RHS) {
113
11.9k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
11.9k
}
CGOpenMPRuntime.cpp:(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags llvm::BitmaskEnumDetail::operator&<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, void>((anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, (anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags)
Line
Count
Source
112
1.42k
E operator&(E LHS, E RHS) {
113
1.42k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
1.42k
}
llvm::pdb::PdbSymbolIdField llvm::BitmaskEnumDetail::operator&<llvm::pdb::PdbSymbolIdField, void>(llvm::pdb::PdbSymbolIdField, llvm::pdb::PdbSymbolIdField)
Line
Count
Source
112
1.32k
E operator&(E LHS, E RHS) {
113
1.32k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
1.32k
}
llvm::pdb::PdbRaw_Features llvm::BitmaskEnumDetail::operator&<llvm::pdb::PdbRaw_Features, void>(llvm::pdb::PdbRaw_Features, llvm::pdb::PdbRaw_Features)
Line
Count
Source
112
94
E operator&(E LHS, E RHS) {
113
94
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
94
}
115
116
template <typename E,
117
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
118
E operator^(E LHS, E RHS) {
119
  return static_cast<E>(Underlying(LHS) ^ Underlying(RHS));
120
}
121
122
// |=, &=, and ^= return a reference to LHS, to match the behavior of the
123
// operators on builtin types.
124
125
template <typename E,
126
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
127
7.90M
E &operator|=(E &LHS, E RHS) {
128
7.90M
  LHS = LHS | RHS;
129
7.90M
  return LHS;
130
7.90M
}
llvm::MachineMemOperand::Flags& llvm::BitmaskEnumDetail::operator|=<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags&, llvm::MachineMemOperand::Flags)
Line
Count
Source
127
7.71M
E &operator|=(E &LHS, E RHS) {
128
7.71M
  LHS = LHS | RHS;
129
7.71M
  return LHS;
130
7.71M
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIAtomicAddrSpace& llvm::BitmaskEnumDetail::operator|=<(anonymous namespace)::SIAtomicAddrSpace, void>((anonymous namespace)::SIAtomicAddrSpace&, (anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
127
47.6k
E &operator|=(E &LHS, E RHS) {
128
47.6k
  LHS = LHS | RHS;
129
47.6k
  return LHS;
130
47.6k
}
llvm::DINode::DIFlags& llvm::BitmaskEnumDetail::operator|=<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags&, llvm::DINode::DIFlags)
Line
Count
Source
127
123k
E &operator|=(E &LHS, E RHS) {
128
123k
  LHS = LHS | RHS;
129
123k
  return LHS;
130
123k
}
CGOpenMPRuntime.cpp:(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags& llvm::BitmaskEnumDetail::operator|=<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, void>((anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags&, (anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags)
Line
Count
Source
127
15.2k
E &operator|=(E &LHS, E RHS) {
128
15.2k
  LHS = LHS | RHS;
129
15.2k
  return LHS;
130
15.2k
}
llvm::pdb::PdbRaw_Features& llvm::BitmaskEnumDetail::operator|=<llvm::pdb::PdbRaw_Features, void>(llvm::pdb::PdbRaw_Features&, llvm::pdb::PdbRaw_Features)
Line
Count
Source
127
69
E &operator|=(E &LHS, E RHS) {
128
69
  LHS = LHS | RHS;
129
69
  return LHS;
130
69
}
131
132
template <typename E,
133
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
134
11.3k
E &operator&=(E &LHS, E RHS) {
135
11.3k
  LHS = LHS & RHS;
136
11.3k
  return LHS;
137
11.3k
}
llvm::DINode::DIFlags& llvm::BitmaskEnumDetail::operator&=<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags&, llvm::DINode::DIFlags)
Line
Count
Source
134
10.2k
E &operator&=(E &LHS, E RHS) {
135
10.2k
  LHS = LHS & RHS;
136
10.2k
  return LHS;
137
10.2k
}
CGOpenMPRuntime.cpp:(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags& llvm::BitmaskEnumDetail::operator&=<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, void>((anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags&, (anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags)
Line
Count
Source
134
844
E &operator&=(E &LHS, E RHS) {
135
844
  LHS = LHS & RHS;
136
844
  return LHS;
137
844
}
llvm::MachineMemOperand::Flags& llvm::BitmaskEnumDetail::operator&=<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags&, llvm::MachineMemOperand::Flags)
Line
Count
Source
134
199
E &operator&=(E &LHS, E RHS) {
135
199
  LHS = LHS & RHS;
136
199
  return LHS;
137
199
}
138
139
template <typename E,
140
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
141
E &operator^=(E &LHS, E RHS) {
142
  LHS = LHS ^ RHS;
143
  return LHS;
144
}
145
146
} // namespace BitmaskEnumDetail
147
148
// Enable bitmask enums in namespace ::llvm and all nested namespaces.
149
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
150
151
} // namespace llvm
152
153
#endif