Coverage Report

Created: 2018-12-14 11:24

/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
102k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
102k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
102k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
102k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
102k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
102k
         1;
87
102k
}
std::__1::underlying_type<llvm::MachineMemOperand::Flags>::type llvm::BitmaskEnumDetail::Mask<llvm::MachineMemOperand::Flags>()
Line
Count
Source
81
25.3k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
25.3k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
25.3k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
25.3k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
25.3k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
25.3k
         1;
87
25.3k
}
std::__1::underlying_type<llvm::DINode::DIFlags>::type llvm::BitmaskEnumDetail::Mask<llvm::DINode::DIFlags>()
Line
Count
Source
81
10.4k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
10.4k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
10.4k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
10.4k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
10.4k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
10.4k
         1;
87
10.4k
}
std::__1::underlying_type<llvm::DISubprogram::DISPFlags>::type llvm::BitmaskEnumDetail::Mask<llvm::DISubprogram::DISPFlags>()
Line
Count
Source
81
5.34k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
5.34k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
5.34k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
5.34k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
5.34k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
5.34k
         1;
87
5.34k
}
CGOpenMPRuntime.cpp:std::__1::underlying_type<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags>::type llvm::BitmaskEnumDetail::Mask<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags>()
Line
Count
Source
81
870
template <typename E> typename std::underlying_type<E>::type Mask() {
82
870
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
870
  // subtracting 1 gives us the mask with all bits set, like we want.
84
870
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
870
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
870
         1;
87
870
}
CGOpenMPRuntimeNVPTX.cpp:std::__1::underlying_type<(anonymous namespace)::ModeFlagsTy>::type llvm::BitmaskEnumDetail::Mask<(anonymous namespace)::ModeFlagsTy>()
Line
Count
Source
81
60.7k
template <typename E> typename std::underlying_type<E>::type Mask() {
82
60.7k
  // On overflow, NextPowerOf2 returns zero with the type uint64_t, so
83
60.7k
  // subtracting 1 gives us the mask with all bits set, like we want.
84
60.7k
  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
85
60.7k
             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
86
60.7k
         1;
87
60.7k
}
88
89
/// Check that Val is in range for E, and return Val cast to E's underlying
90
/// type.
91
325M
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
325M
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
325M
  assert(U >= 0 && "Negative enum values are not allowed.");
94
325M
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
325M
  return U;
96
325M
}
std::__1::underlying_type<llvm::MachineMemOperand::Flags>::type llvm::BitmaskEnumDetail::Underlying<llvm::MachineMemOperand::Flags>(llvm::MachineMemOperand::Flags)
Line
Count
Source
91
316M
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
316M
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
316M
  assert(U >= 0 && "Negative enum values are not allowed.");
94
316M
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
316M
  return U;
96
316M
}
std::__1::underlying_type<llvm::BinaryStreamFlags>::type llvm::BitmaskEnumDetail::Underlying<llvm::BinaryStreamFlags>(llvm::BinaryStreamFlags)
Line
Count
Source
91
486k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
486k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
486k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
486k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
486k
  return U;
96
486k
}
std::__1::underlying_type<llvm::DINode::DIFlags>::type llvm::BitmaskEnumDetail::Underlying<llvm::DINode::DIFlags>(llvm::DINode::DIFlags)
Line
Count
Source
91
5.96M
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
5.96M
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
5.96M
  assert(U >= 0 && "Negative enum values are not allowed.");
94
5.96M
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
5.96M
  return U;
96
5.96M
}
std::__1::underlying_type<llvm::DISubprogram::DISPFlags>::type llvm::BitmaskEnumDetail::Underlying<llvm::DISubprogram::DISPFlags>(llvm::DISubprogram::DISPFlags)
Line
Count
Source
91
1.76M
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
1.76M
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
1.76M
  assert(U >= 0 && "Negative enum values are not allowed.");
94
1.76M
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
1.76M
  return U;
96
1.76M
}
SIMemoryLegalizer.cpp:std::__1::underlying_type<(anonymous namespace)::SIAtomicAddrSpace>::type llvm::BitmaskEnumDetail::Underlying<(anonymous namespace)::SIAtomicAddrSpace>((anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
91
124k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
124k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
124k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
124k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
124k
  return U;
96
124k
}
SIMemoryLegalizer.cpp:std::__1::underlying_type<(anonymous namespace)::SIMemOp>::type llvm::BitmaskEnumDetail::Underlying<(anonymous namespace)::SIMemOp>((anonymous namespace)::SIMemOp)
Line
Count
Source
91
3.06k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
3.06k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
3.06k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
3.06k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
3.06k
  return U;
96
3.06k
}
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
92.2k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
92.2k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
92.2k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
92.2k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
92.2k
  return U;
96
92.2k
}
CGOpenMPRuntimeNVPTX.cpp:std::__1::underlying_type<(anonymous namespace)::ModeFlagsTy>::type llvm::BitmaskEnumDetail::Underlying<(anonymous namespace)::ModeFlagsTy>((anonymous namespace)::ModeFlagsTy)
Line
Count
Source
91
182k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
182k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
182k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
182k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
182k
  return U;
96
182k
}
std::__1::underlying_type<clang::Parser::AngleBracketTracker::Priority>::type llvm::BitmaskEnumDetail::Underlying<clang::Parser::AngleBracketTracker::Priority>(clang::Parser::AngleBracketTracker::Priority)
Line
Count
Source
91
448k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
448k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
448k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
448k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
448k
  return U;
96
448k
}
std::__1::underlying_type<llvm::pdb::PdbSymbolIdField>::type llvm::BitmaskEnumDetail::Underlying<llvm::pdb::PdbSymbolIdField>(llvm::pdb::PdbSymbolIdField)
Line
Count
Source
91
2.68k
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
2.68k
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
2.68k
  assert(U >= 0 && "Negative enum values are not allowed.");
94
2.68k
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
2.68k
  return U;
96
2.68k
}
std::__1::underlying_type<llvm::pdb::PdbRaw_Features>::type llvm::BitmaskEnumDetail::Underlying<llvm::pdb::PdbRaw_Features>(llvm::pdb::PdbRaw_Features)
Line
Count
Source
91
384
template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
92
384
  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
93
384
  assert(U >= 0 && "Negative enum values are not allowed.");
94
384
  assert(U <= Mask<E>() && "Enum value too large (or largest val too small?)");
95
384
  return U;
96
384
}
97
98
template <typename E,
99
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
100
102k
E operator~(E Val) {
101
102k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
102k
}
llvm::MachineMemOperand::Flags llvm::BitmaskEnumDetail::operator~<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags)
Line
Count
Source
100
25.3k
E operator~(E Val) {
101
25.3k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
25.3k
}
llvm::DINode::DIFlags llvm::BitmaskEnumDetail::operator~<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags)
Line
Count
Source
100
10.4k
E operator~(E Val) {
101
10.4k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
10.4k
}
llvm::DISubprogram::DISPFlags llvm::BitmaskEnumDetail::operator~<llvm::DISubprogram::DISPFlags, void>(llvm::DISubprogram::DISPFlags)
Line
Count
Source
100
5.34k
E operator~(E Val) {
101
5.34k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
5.34k
}
CGOpenMPRuntime.cpp:(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags llvm::BitmaskEnumDetail::operator~<(anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags, void>((anonymous namespace)::MappableExprsHandler::OpenMPOffloadMappingFlags)
Line
Count
Source
100
870
E operator~(E Val) {
101
870
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
870
}
CGOpenMPRuntimeNVPTX.cpp:(anonymous namespace)::ModeFlagsTy llvm::BitmaskEnumDetail::operator~<(anonymous namespace)::ModeFlagsTy, void>((anonymous namespace)::ModeFlagsTy)
Line
Count
Source
100
60.7k
E operator~(E Val) {
101
60.7k
  return static_cast<E>(~Underlying(Val) & Mask<E>());
102
60.7k
}
103
104
template <typename E,
105
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
106
8.65M
E operator|(E LHS, E RHS) {
107
8.65M
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
8.65M
}
llvm::MachineMemOperand::Flags llvm::BitmaskEnumDetail::operator|<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags, llvm::MachineMemOperand::Flags)
Line
Count
Source
106
7.85M
E operator|(E LHS, E RHS) {
107
7.85M
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
7.85M
}
llvm::BinaryStreamFlags llvm::BitmaskEnumDetail::operator|<llvm::BinaryStreamFlags, void>(llvm::BinaryStreamFlags, llvm::BinaryStreamFlags)
Line
Count
Source
106
36.5k
E operator|(E LHS, E RHS) {
107
36.5k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
36.5k
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIAtomicAddrSpace llvm::BitmaskEnumDetail::operator|<(anonymous namespace)::SIAtomicAddrSpace, void>((anonymous namespace)::SIAtomicAddrSpace, (anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
106
49.2k
E operator|(E LHS, E RHS) {
107
49.2k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
49.2k
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIMemOp llvm::BitmaskEnumDetail::operator|<(anonymous namespace)::SIMemOp, void>((anonymous namespace)::SIMemOp, (anonymous namespace)::SIMemOp)
Line
Count
Source
106
1.53k
E operator|(E LHS, E RHS) {
107
1.53k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
1.53k
}
llvm::DISubprogram::DISPFlags llvm::BitmaskEnumDetail::operator|<llvm::DISubprogram::DISPFlags, void>(llvm::DISubprogram::DISPFlags, llvm::DISubprogram::DISPFlags)
Line
Count
Source
106
217k
E operator|(E LHS, E RHS) {
107
217k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
217k
}
llvm::DINode::DIFlags llvm::BitmaskEnumDetail::operator|<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags, llvm::DINode::DIFlags)
Line
Count
Source
106
226k
E operator|(E LHS, E RHS) {
107
226k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
226k
}
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
44.1k
E operator|(E LHS, E RHS) {
107
44.1k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
44.1k
}
CGOpenMPRuntimeNVPTX.cpp:(anonymous namespace)::ModeFlagsTy llvm::BitmaskEnumDetail::operator|<(anonymous namespace)::ModeFlagsTy, void>((anonymous namespace)::ModeFlagsTy, (anonymous namespace)::ModeFlagsTy)
Line
Count
Source
106
493
E operator|(E LHS, E RHS) {
107
493
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
493
}
clang::Parser::AngleBracketTracker::Priority llvm::BitmaskEnumDetail::operator|<clang::Parser::AngleBracketTracker::Priority, void>(clang::Parser::AngleBracketTracker::Priority, clang::Parser::AngleBracketTracker::Priority)
Line
Count
Source
106
224k
E operator|(E LHS, E RHS) {
107
224k
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
224k
}
llvm::pdb::PdbRaw_Features llvm::BitmaskEnumDetail::operator|<llvm::pdb::PdbRaw_Features, void>(llvm::pdb::PdbRaw_Features, llvm::pdb::PdbRaw_Features)
Line
Count
Source
106
78
E operator|(E LHS, E RHS) {
107
78
  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
108
78
}
109
110
template <typename E,
111
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
112
154M
E operator&(E LHS, E RHS) {
113
154M
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
154M
}
llvm::MachineMemOperand::Flags llvm::BitmaskEnumDetail::operator&<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags, llvm::MachineMemOperand::Flags)
Line
Count
Source
112
150M
E operator&(E LHS, E RHS) {
113
150M
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
150M
}
llvm::BinaryStreamFlags llvm::BitmaskEnumDetail::operator&<llvm::BinaryStreamFlags, void>(llvm::BinaryStreamFlags, llvm::BinaryStreamFlags)
Line
Count
Source
112
206k
E operator&(E LHS, E RHS) {
113
206k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
206k
}
llvm::DINode::DIFlags llvm::BitmaskEnumDetail::operator&<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags, llvm::DINode::DIFlags)
Line
Count
Source
112
2.75M
E operator&(E LHS, E RHS) {
113
2.75M
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
2.75M
}
llvm::DISubprogram::DISPFlags llvm::BitmaskEnumDetail::operator&<llvm::DISubprogram::DISPFlags, void>(llvm::DISubprogram::DISPFlags, llvm::DISubprogram::DISPFlags)
Line
Count
Source
112
660k
E operator&(E LHS, E RHS) {
113
660k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
660k
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIAtomicAddrSpace llvm::BitmaskEnumDetail::operator&<(anonymous namespace)::SIAtomicAddrSpace, void>((anonymous namespace)::SIAtomicAddrSpace, (anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
112
13.1k
E operator&(E LHS, E RHS) {
113
13.1k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
13.1k
}
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.50k
E operator&(E LHS, E RHS) {
113
1.50k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
1.50k
}
CGOpenMPRuntimeNVPTX.cpp:(anonymous namespace)::ModeFlagsTy llvm::BitmaskEnumDetail::operator&<(anonymous namespace)::ModeFlagsTy, void>((anonymous namespace)::ModeFlagsTy, (anonymous namespace)::ModeFlagsTy)
Line
Count
Source
112
60.4k
E operator&(E LHS, E RHS) {
113
60.4k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
60.4k
}
llvm::pdb::PdbSymbolIdField llvm::BitmaskEnumDetail::operator&<llvm::pdb::PdbSymbolIdField, void>(llvm::pdb::PdbSymbolIdField, llvm::pdb::PdbSymbolIdField)
Line
Count
Source
112
1.33k
E operator&(E LHS, E RHS) {
113
1.33k
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
1.33k
}
llvm::pdb::PdbRaw_Features llvm::BitmaskEnumDetail::operator&<llvm::pdb::PdbRaw_Features, void>(llvm::pdb::PdbRaw_Features, llvm::pdb::PdbRaw_Features)
Line
Count
Source
112
114
E operator&(E LHS, E RHS) {
113
114
  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
114
114
}
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.91M
E &operator|=(E &LHS, E RHS) {
128
7.91M
  LHS = LHS | RHS;
129
7.91M
  return LHS;
130
7.91M
}
llvm::MachineMemOperand::Flags& llvm::BitmaskEnumDetail::operator|=<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags&, llvm::MachineMemOperand::Flags)
Line
Count
Source
127
7.62M
E &operator|=(E &LHS, E RHS) {
128
7.62M
  LHS = LHS | RHS;
129
7.62M
  return LHS;
130
7.62M
}
SIMemoryLegalizer.cpp:(anonymous namespace)::SIAtomicAddrSpace& llvm::BitmaskEnumDetail::operator|=<(anonymous namespace)::SIAtomicAddrSpace, void>((anonymous namespace)::SIAtomicAddrSpace&, (anonymous namespace)::SIAtomicAddrSpace)
Line
Count
Source
127
49.2k
E &operator|=(E &LHS, E RHS) {
128
49.2k
  LHS = LHS | RHS;
129
49.2k
  return LHS;
130
49.2k
}
llvm::DINode::DIFlags& llvm::BitmaskEnumDetail::operator|=<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags&, llvm::DINode::DIFlags)
Line
Count
Source
127
117k
E &operator|=(E &LHS, E RHS) {
128
117k
  LHS = LHS | RHS;
129
117k
  return LHS;
130
117k
}
llvm::DISubprogram::DISPFlags& llvm::BitmaskEnumDetail::operator|=<llvm::DISubprogram::DISPFlags, void>(llvm::DISubprogram::DISPFlags&, llvm::DISubprogram::DISPFlags)
Line
Count
Source
127
111k
E &operator|=(E &LHS, E RHS) {
128
111k
  LHS = LHS | RHS;
129
111k
  return LHS;
130
111k
}
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.3k
E &operator|=(E &LHS, E RHS) {
128
15.3k
  LHS = LHS | RHS;
129
15.3k
  return LHS;
130
15.3k
}
llvm::pdb::PdbRaw_Features& llvm::BitmaskEnumDetail::operator|=<llvm::pdb::PdbRaw_Features, void>(llvm::pdb::PdbRaw_Features&, llvm::pdb::PdbRaw_Features)
Line
Count
Source
127
78
E &operator|=(E &LHS, E RHS) {
128
78
  LHS = LHS | RHS;
129
78
  return LHS;
130
78
}
131
132
template <typename E,
133
          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
134
16.8k
E &operator&=(E &LHS, E RHS) {
135
16.8k
  LHS = LHS & RHS;
136
16.8k
  return LHS;
137
16.8k
}
llvm::DINode::DIFlags& llvm::BitmaskEnumDetail::operator&=<llvm::DINode::DIFlags, void>(llvm::DINode::DIFlags&, llvm::DINode::DIFlags)
Line
Count
Source
134
10.4k
E &operator&=(E &LHS, E RHS) {
135
10.4k
  LHS = LHS & RHS;
136
10.4k
  return LHS;
137
10.4k
}
llvm::DISubprogram::DISPFlags& llvm::BitmaskEnumDetail::operator&=<llvm::DISubprogram::DISPFlags, void>(llvm::DISubprogram::DISPFlags&, llvm::DISubprogram::DISPFlags)
Line
Count
Source
134
5.34k
E &operator&=(E &LHS, E RHS) {
135
5.34k
  LHS = LHS & RHS;
136
5.34k
  return LHS;
137
5.34k
}
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
870
E &operator&=(E &LHS, E RHS) {
135
870
  LHS = LHS & RHS;
136
870
  return LHS;
137
870
}
llvm::MachineMemOperand::Flags& llvm::BitmaskEnumDetail::operator&=<llvm::MachineMemOperand::Flags, void>(llvm::MachineMemOperand::Flags&, llvm::MachineMemOperand::Flags)
Line
Count
Source
134
200
E &operator&=(E &LHS, E RHS) {
135
200
  LHS = LHS & RHS;
136
200
  return LHS;
137
200
}
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