13#ifndef LLVM_FRONTEND_OPENMP_OMP_H
14#define LLVM_FRONTEND_OPENMP_OMP_H
26#include "llvm/Frontend/OpenMP/OMP.h.inc"
29template <
typename Enum,
size_t Size>
struct EnumSet;
33static constexpr inline size_t findFirstSet(
size_t Begin,
size_t End,
35 unsigned BeginWord = Begin / 64;
36 unsigned EndWord = (End + 63) / 64;
38 for (
unsigned I = BeginWord;
I < EndWord; ++
I) {
40 if (
I == BeginWord && Begin % 64 != 0) {
45 unsigned Idx =
I * 64 +
Count;
46 if (Idx >= Begin && Idx < End)
76template <
typename Enum,
size_t Size>
86 auto Value =
static_cast<unsigned>(
E);
96 constexpr bool test(Enum
E)
const {
139template <
typename Enum,
size_t Size>
143 return static_cast<Enum
>(At);
146template <
typename Enum,
size_t Size>
195 case OMPC_firstprivate:
196 case OMPC_in_reduction:
197 case OMPC_lastprivate:
201 case OMPC_task_reduction:
205 case OMPC_is_device_ptr:
206 case OMPC_use_device_ptr:
219 case OMPC_firstprivate:
220 case OMPC_has_device_addr:
222 case OMPC_in_reduction:
223 case OMPC_is_device_ptr:
224 case OMPC_lastprivate:
229 case OMPC_task_reduction:
230 case OMPC_use_device_addr:
231 case OMPC_use_device_ptr:
232 case OMPC_uses_allocators:
241 case OMPC_copyprivate:
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines DenseMapInfo traits for DenseMap.
Provides some synthesis utilities to produce sequences of values.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
This is a constexpr reimplementation of a subset of std::bitset.
constexpr size_t count() const
constexpr Bitset & flip(unsigned I)
constexpr bool none() const
constexpr bool operator[](unsigned I) const
constexpr size_t size() const
constexpr Bitset & operator|=(const Bitset &RHS)
constexpr Bitset & operator&=(const Bitset &RHS)
constexpr bool test(unsigned I) const
constexpr Bitset & reset(unsigned I)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Represent a constant reference to a string, i.e.
LLVM Value Representation.
static constexpr size_t findFirstSet(size_t Begin, size_t End, const llvm::Bitset< Size > &Set)
static constexpr auto clauses()
LLVM_ABI bool isCombinedConstruct(Directive D)
LLVM_ABI std::string deconstructOpenMPKernelName(StringRef KernelName, unsigned &LineNo)
Deconstruct an OpenMP kernel name into the parent function name and the line number.
static constexpr bool isEndClause(Clause C)
LLVM_ABI ArrayRef< Directive > getLeafOrCompositeConstructs(Directive D, SmallVectorImpl< Directive > &Output)
static constexpr bool canHaveIterator(Clause C)
Can clause C have an iterator-modifier.
LLVM_ABI bool isCompositeConstruct(Directive D)
static constexpr Version FallbackVersion(52)
LLVM_ABI bool isPrivatizingConstruct(Directive D, Version V)
Can directive D, under some circumstances, create a private copy of a variable in given OpenMP versio...
EnumSet< llvm::omp::Clause, llvm::omp::Clause_enumSize > ClauseSet
LLVM_ABI Directive getCompoundConstruct(ArrayRef< Directive > Parts)
LLVM_ABI ArrayRef< Version > getOpenMPVersions()
LLVM_ABI ArrayRef< StringRef > getReservedLocatorNames()
LLVM_ABI bool isLeafConstruct(Directive D)
LLVM_ABI ArrayRef< Directive > getLeafConstructsOrSelf(Directive D)
static constexpr bool isPrivatizingClause(Clause C, Version V)
LLVM_ABI std::string prettifyFunctionName(StringRef FunctionName)
Create a nicer version of a function name for humans to look at.
static constexpr auto directives()
EnumSet< llvm::omp::Directive, llvm::omp::Directive_enumSize > DirectiveSet
LLVM_ABI ArrayRef< Directive > getLeafConstructs(Directive D)
static constexpr bool isDataSharingAttributeClause(Clause C, Version V)
constexpr auto enum_seq_inclusive(EnumT Begin, EnumT End)
Iterate over an enum type from Begin to End inclusive.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
constexpr int countr_zero_constexpr(T Val)
Count number of 0's from the least significant bit to the most stopping at the first 1.
Implement std::hash so that hash_code can be used in STL containers.
constexpr bool operator[](Enum E) const
detail::EnumSetIterator< Enum, Size > iterator
constexpr EnumSet(std::initializer_list< value_type > Init)
constexpr size_t max_size() const
constexpr bool test(Enum E) const
constexpr EnumSet(Base &&B)
constexpr EnumSet & set(Enum E)
constexpr EnumSet & reset(Enum E)
constexpr EnumSet & operator|=(const EnumSet &S)
constexpr iterator begin() const
constexpr EnumSet operator&(const EnumSet &S) const
constexpr size_t size() const
constexpr EnumSet & operator&=(const EnumSet &S)
constexpr bool empty() const
constexpr EnumSet operator|(const EnumSet &S) const
llvm::Bitset< Size > Base
constexpr EnumSet & flip(Enum E)
constexpr iterator end() const
constexpr bool operator==(const EnumSetIterator< Enum, Size > &Other) const
static constexpr size_t enum_size
constexpr Enum operator*() const
constexpr auto & operator++()
constexpr EnumSetIterator(const EnumSet< Enum, Size > &Set, size_t At)
constexpr bool operator!=(const EnumSetIterator< Enum, Size > &Other) const