13#ifndef LLVM_FRONTEND_OPENMP_OMP_H
14#define LLVM_FRONTEND_OPENMP_OMP_H
27#include "llvm/Frontend/OpenMP/OMP.h.inc"
30template <
typename Enum,
size_t Size>
struct EnumSet;
36 unsigned BeginWord = Begin / 64;
37 unsigned EndWord = (
End + 63) / 64;
39 for (
unsigned I = BeginWord;
I < EndWord; ++
I) {
41 if (
I == BeginWord && Begin % 64 != 0) {
46 unsigned Idx =
I * 64 +
Count;
47 if (Idx >= Begin && Idx <
End)
77template <
typename Enum>
81template <
typename Enum,
size_t Size = EnumSize<Enum>>
91 auto Value =
static_cast<unsigned>(
E);
144template <
typename Enum,
size_t Size>
148 return static_cast<Enum
>(At);
151template <
typename Enum,
size_t Size>
199 case OMPC_firstprivate:
200 case OMPC_in_reduction:
201 case OMPC_lastprivate:
205 case OMPC_task_reduction:
209 case OMPC_is_device_ptr:
210 case OMPC_use_device_ptr:
223 case OMPC_firstprivate:
224 case OMPC_has_device_addr:
226 case OMPC_in_reduction:
227 case OMPC_is_device_ptr:
228 case OMPC_lastprivate:
233 case OMPC_task_reduction:
234 case OMPC_use_device_addr:
235 case OMPC_use_device_ptr:
236 case OMPC_uses_allocators:
245 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.
This file contains library features backported from future STL versions.
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)
EnumSet< Directive > Directives
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< Clause > Clauses
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)
constexpr size_t EnumSize
LLVM_ABI std::string prettifyFunctionName(StringRef FunctionName)
Create a nicer version of a function name for humans to look at.
static constexpr auto directives()
LLVM_ABI ArrayRef< Directive > getLeafConstructs(Directive D)
static constexpr bool isDataSharingAttributeClause(Clause C, Version V)
constexpr std::underlying_type_t< Enum > to_underlying(Enum E)
Returns underlying integer value of an enum.
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.
@ End
Run the machine verifier once, at the end of the pipeline.
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