13#ifndef LLVM_FRONTEND_OPENMP_OMP_H
14#define LLVM_FRONTEND_OPENMP_OMP_H
16#include "llvm/Frontend/OpenMP/OMP.h.inc"
26template <
typename Enum,
size_t Size>
struct EnumSet;
30static constexpr inline size_t findFirstSet(
size_t Begin,
size_t End,
32 unsigned BeginWord = Begin / 64;
33 unsigned EndWord = (End + 63) / 64;
35 for (
unsigned I = BeginWord;
I < EndWord; ++
I) {
37 if (
I == BeginWord && Begin % 64 != 0) {
42 unsigned Idx =
I * 64 +
Count;
43 if (Idx >= Begin && Idx < End)
73template <
typename Enum,
size_t Size>
83 auto Value =
static_cast<unsigned>(
E);
93 constexpr bool test(Enum
E)
const {
136template <
typename Enum,
size_t Size>
140 return static_cast<Enum
>(At);
143template <
typename Enum,
size_t Size>
192 case OMPC_firstprivate:
193 case OMPC_in_reduction:
194 case OMPC_lastprivate:
198 case OMPC_task_reduction:
202 case OMPC_is_device_ptr:
203 case OMPC_use_device_ptr:
217 case OMPC_firstprivate:
218 case OMPC_has_device_addr:
220 case OMPC_in_reduction:
221 case OMPC_is_device_ptr:
222 case OMPC_lastprivate:
227 case OMPC_task_reduction:
228 case OMPC_use_device_addr:
229 case OMPC_use_device_ptr:
230 case OMPC_uses_allocators:
239 case OMPC_copyprivate:
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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")
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.
@ C
The default llvm calling convention, compatible with C.
static constexpr size_t findFirstSet(size_t Begin, size_t End, const llvm::Bitset< Size > &Set)
static constexpr auto clauses()
LLVM_ABI ArrayRef< unsigned > getOpenMPVersions()
static constexpr bool isDataSharingAttributeClause(Clause C, unsigned Version)
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)
LLVM_ABI bool isPrivatizingConstruct(Directive D, unsigned Version)
Can directive D, under some circumstances, create a private copy of a variable in given OpenMP versio...
static constexpr bool canHaveIterator(Clause C)
Can clause C have an iterator-modifier.
LLVM_ABI bool isCompositeConstruct(Directive D)
EnumSet< llvm::omp::Clause, llvm::omp::Clause_enumSize > ClauseSet
LLVM_ABI Directive getCompoundConstruct(ArrayRef< Directive > Parts)
static constexpr unsigned FallbackVersion
LLVM_ABI ArrayRef< StringRef > getReservedLocatorNames()
LLVM_ABI bool isLeafConstruct(Directive D)
LLVM_ABI ArrayRef< Directive > getLeafConstructsOrSelf(Directive D)
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 isPrivatizingClause(Clause C, unsigned Version)
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