41#ifndef LLVM_FRONTEND_OPENMP_CLAUSET_H
42#define LLVM_FRONTEND_OPENMP_CLAUSET_H
61#define ENUM(Name, ...) enum class Name { __VA_ARGS__ }
62#define OPT(x) std::optional<x>
76#define CLAUSET_SCOPED_ENUM_MEMBER_CONVERT(Ov, Tv) \
77 if (v == OtherEnum::Ov) { \
78 return ThisEnum::Tv; \
82#define CLAUSET_UNSCOPED_ENUM_MEMBER_CONVERT(Ov, Tv) \
84 return ThisEnum::Tv; \
87#define CLAUSET_ENUM_CONVERT(func, OtherE, ThisE, Maps) \
88 auto func = [](OtherE v) -> ThisE { \
89 using ThisEnum = ThisE; \
90 using OtherEnum = OtherE; \
91 (void)sizeof(OtherEnum); \
93 llvm_unreachable("Unexpected value in " #OtherE); \
115 static constexpr bool value =
false;
127template <
typename... Types1,
typename... Types2>
129 using type = std::variant<Types1..., Types2...>;
145template <
typename T,
typename... Ts>
struct Union<
T, Ts...> {
146 static_assert(detail::is_variant_v<T>);
181template <
typename IdType,
typename ExprType>
struct ObjectT;
184template <
typename I,
typename E>
186 return o1.id() == o2.id();
193template <
typename I,
typename E>
199 ENUM(IntrinsicOperator, Power, Multiply, Divide, Add, Subtract,
Concat, LT,
200 LE,
EQ, NE, GE, GT, NOT, AND, OR, EQV, NEQV, Min, Max);
202 std::variant<DefinedOpName, IntrinsicOperator>
u;
214template <
typename TypeType,
typename IdType,
typename ExprType>
230template <
typename I,
typename E>
239ENUM(MemoryOrder, AcqRel, Acquire, Relaxed, Release, SeqCst);
240ENUM(MotionExpectation, Present);
242ENUM(TaskDependenceType, In, Out, Inout, Mutexinoutset, Inoutset, Depobj);
244template <
typename I,
typename E>
248 std::tuple<DefinedOperatorT<I, E>,
E>
t;
254template <
typename I,
typename E>
267template <
typename I,
typename E>
273template <
typename T,
typename I,
typename E>
277std::enable_if_t<T::EmptyTrait::value, bool> operator==(
const T &a,
282std::enable_if_t<T::IncompleteTrait::value, bool> operator==(
const T &a,
287std::enable_if_t<T::WrapperTrait::value, bool> operator==(
const T &a,
292std::enable_if_t<T::TupleTrait::value, bool> operator==(
const T &a,
297std::enable_if_t<T::UnionTrait::value, bool> operator==(
const T &a,
308template <
typename T,
typename I,
typename E>
312 typename ContainerTy,
typename FunctionTy,
314 typename ResultTy = std::invoke_result_t<FunctionTy, ElemTy>>
322using type::operator==;
325template <
typename T,
typename I,
typename E>
333template <
typename T,
typename I,
typename E>
339template <
typename T,
typename I,
typename E>
345template <
typename T,
typename I,
typename E>
351template <
typename T,
typename I,
typename E>
361template <
typename T,
typename I,
typename E>
370template <
typename T,
typename I,
typename E>
379template <
typename T,
typename I,
typename E>
383template <
typename T,
typename I,
typename E>
397template <
typename T,
typename I,
typename E>
405template <
typename T,
typename I,
typename E>
411template <
typename T,
typename I,
typename E>
413 ENUM(ActionTime, Compilation, Execution);
419template <
typename T,
typename I,
typename E>
427template <
typename T,
typename I,
typename E>
435template <
typename T,
typename I,
typename E>
441template <
typename T,
typename I,
typename E>
449template <
typename T,
typename I,
typename E>
455template <
typename T,
typename I,
typename E>
463template <
typename T,
typename I,
typename E>
471template <
typename T,
typename I,
typename E>
479template <
typename T,
typename I,
typename E>
481 ENUM(DataSharingAttribute, Firstprivate,
None, Private, Shared);
483 DataSharingAttribute
v;
487template <
typename T,
typename I,
typename E>
491 ENUM(VariableCategory, Scalar, Aggregate, Pointer, Allocatable);
493 std::tuple<ImplicitBehavior,
OPT(VariableCategory)>
t;
496template <
typename T,
typename I,
typename E>
500template <
typename T,
typename I,
typename E>
514 std::variant<Doacross, WithLocators>
u;
518template <
typename T,
typename I,
typename E>
527template <
typename T,
typename I,
typename E>
535template <
typename T,
typename I,
typename E>
538 ENUM(DeviceModifier, Ancestor, DeviceNum);
544template <
typename T,
typename I,
typename E>
546 ENUM(DeviceTypeDescription, Any, Host, Nohost);
548 DeviceTypeDescription
v;
552template <
typename T,
typename I,
typename E>
561template <
typename T,
typename I,
typename E>
564 ENUM(DependenceType, Source, Sink);
567 std::tuple<DependenceType, Vector>
t;
571template <
typename T,
typename I,
typename E>
577template <
typename T,
typename I,
typename E>
585template <
typename T,
typename I,
typename E>
593template <
typename T,
typename I,
typename E>
601template <
typename T,
typename I,
typename E>
609template <
typename T,
typename I,
typename E>
617template <
typename T,
typename I,
typename E>
625template <
typename T,
typename I,
typename E>
638template <
typename T,
typename I,
typename E>
644template <
typename T,
typename I,
typename E>
646 ENUM(Prescriptiveness, Strict);
653template <
typename T,
typename I,
typename E>
661template <
typename T,
typename I,
typename E>
669template <
typename T,
typename I,
typename E>
676template <
typename T,
typename I,
typename E>
685template <
typename T,
typename I,
typename E>
691template <
typename T,
typename I,
typename E>
699template <
typename T,
typename I,
typename E>
707template <
typename T,
typename I,
typename E>
712 ENUM(InteropType, Target, Targetsync);
720template <
typename T,
typename I,
typename E>
728template <
typename T,
typename I,
typename E>
735 std::tuple<ReductionIdentifiers, List>
t;
739template <
typename T,
typename I,
typename E>
747template <
typename T,
typename I,
typename E>
750 ENUM(LastprivateModifier, Conditional);
756template <
typename T,
typename I,
typename E>
762 ENUM(LinearModifier, Ref, Val, Uval);
772template <
typename T,
typename I,
typename E>
780template <
typename T,
typename I,
typename E>
783 ENUM(MapType, To,
From, Tofrom, Alloc, Release, Delete);
784 ENUM(MapTypeModifier, Always, Close, Present, OmpxHold);
797template <
typename T,
typename I,
typename E>
803template <
typename T,
typename I,
typename E>
809template <
typename T,
typename I,
typename E>
817template <
typename T,
typename I,
typename E>
825template <
typename T,
typename I,
typename E>
831template <
typename T,
typename I,
typename E>
839template <
typename T,
typename I,
typename E>
845template <
typename T,
typename I,
typename E>
851template <
typename T,
typename I,
typename E>
857template <
typename T,
typename I,
typename E>
863template <
typename T,
typename I,
typename E>
871template <
typename T,
typename I,
typename E>
877template <
typename T,
typename I,
typename E>
880 ENUM(Prescriptiveness, Strict);
886template <
typename T,
typename I,
typename E>
905template <
typename T,
typename I,
typename E>
912template <
typename T,
typename I,
typename E>
917template <
typename T,
typename I,
typename E>
922template <
typename T,
typename I,
typename E>
929template <
typename T,
typename I,
typename E>
931 ENUM(OrderModifier, Reproducible, Unconstrained);
934 std::tuple<
OPT(OrderModifier), Ordering>
t;
938template <
typename T,
typename I,
typename E>
946template <
typename T,
typename I,
typename E>
952template <
typename T,
typename I,
typename E>
960template <
typename T,
typename I,
typename E>
968template <
typename T,
typename I,
typename E>
976template <
typename T,
typename I,
typename E>
978 ENUM(AffinityPolicy, Close, Master, Spread, Primary);
984template <
typename T,
typename I,
typename E>
990template <
typename T,
typename I,
typename E>
1002template <
typename T,
typename I,
typename E>
1008template <
typename T,
typename I,
typename E>
1014template <
typename T,
typename I,
typename E>
1020template <
typename T,
typename I,
typename E>
1028template <
typename T,
typename I,
typename E>
1030 ENUM(Kind, Static, Dynamic, Guided, Auto, Runtime);
1032 ENUM(OrderingModifier, Monotonic, Nonmonotonic);
1039template <
typename T,
typename I,
typename E>
1045template <
typename T,
typename I,
typename E>
1053template <
typename T,
typename I,
typename E>
1061template <
typename T,
typename I,
typename E>
1067template <
typename T,
typename I,
typename E>
1075template <
typename T,
typename I,
typename E>
1083template <
typename T,
typename I,
typename E>
1090 std::tuple<ReductionIdentifiers, List>
t;
1094template <
typename T,
typename I,
typename E>
1102template <
typename T,
typename I,
typename E>
1108template <
typename T,
typename I,
typename E>
1121template <
typename T,
typename I,
typename E>
1127template <
typename T,
typename I,
typename E>
1133template <
typename T,
typename I,
typename E>
1140template <
typename T,
typename I,
typename E>
1146template <
typename T,
typename I,
typename E>
1154template <
typename T,
typename I,
typename E>
1162template <
typename T,
typename I,
typename E>
1170template <
typename T,
typename I,
typename E>
1178template <
typename T,
typename I,
typename E>
1186template <
typename T,
typename I,
typename E>
1201template <
typename T,
typename I,
typename E>
1207template <
typename T,
typename I,
typename E>
1213template <
typename T,
typename I,
typename E>
1220template <
typename T,
typename I,
typename E>
1225template <
typename T,
typename I,
typename E>
1227 AcqRelT<T, I, E>,
AcquireT<T, I, E>,
CaptureT<T, I, E>,
CompareT<T, I, E>,
1231 NowaitT<T, I, E>,
ReadT<T, I, E>,
RelaxedT<T, I, E>,
ReleaseT<T, I, E>,
1234 UnknownT<T, I, E>,
UntiedT<T, I, E>,
UseT<T, I, E>,
WeakT<T, I, E>,
1237template <
typename T,
typename I,
typename E>
1242template <
typename T,
typename I,
typename E>
1252template <
typename T,
typename I,
typename E>
1255template <
typename T,
typename I,
typename E>
1262 ExclusiveT<T, I, E>,
FailT<T, I, E>,
FilterT<T, I, E>,
FinalT<T, I, E>,
1268 OrderedT<T, I, E>,
PartialT<T, I, E>,
PriorityT<T, I, E>,
PrivateT<T, I, E>,
1269 ProcBindT<T, I, E>,
SafelenT<T, I, E>,
SeverityT<T, I, E>,
SharedT<T, I, E>,
1274template <
typename T,
typename I,
typename E>
1285using type::operator==;
1299template <
typename TypeType,
typename IdType,
typename ExprType,
1311 std::variant<Extras...>>::type;
1319 llvm::omp::Directive
id = llvm::omp::Directive::OMPD_unknown;
BlockVerifier::State From
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the DenseMap class.
This file defines the DenseSet and SmallDenseSet classes.
This file defines the SmallVector class.
static constexpr int Concat[]
constexpr bool is_variant_v
OutputIt transform(R &&Range, OutputIt d_first, UnaryFunction F)
Wrapper function around std::transform to apply a function to a range and store the result elsewhere.
typename llvm::remove_cvref< T >::type remove_cvref_t
Implement std::hash so that hash_code can be used in STL containers.
std::variant< DependT< T, I, E > > UnionClausesT
std::variant< AcqRelT< T, I, E >, AcquireT< T, I, E >, CaptureT< T, I, E >, CompareT< T, I, E >, DynamicAllocatorsT< T, I, E >, FullT< T, I, E >, InbranchT< T, I, E >, MergeableT< T, I, E >, NogroupT< T, I, E >, NoOpenmpRoutinesT< T, I, E >, NoOpenmpT< T, I, E >, NoParallelismT< T, I, E >, NotinbranchT< T, I, E >, NowaitT< T, I, E >, ReadT< T, I, E >, RelaxedT< T, I, E >, ReleaseT< T, I, E >, ReverseOffloadT< T, I, E >, SeqCstT< T, I, E >, SimdT< T, I, E >, ThreadsT< T, I, E >, UnifiedAddressT< T, I, E >, UnifiedSharedMemoryT< T, I, E >, UnknownT< T, I, E >, UntiedT< T, I, E >, UseT< T, I, E >, WeakT< T, I, E >, WriteT< T, I, E > > EmptyClausesT
typename type::Union< EmptyClausesT< T, I, E >, ExtensionClausesT< T, I, E >, IncompleteClausesT< T, I, E >, TupleClausesT< T, I, E >, UnionClausesT< T, I, E >, WrapperClausesT< T, I, E > >::type UnionOfAllClausesT
std::variant< AbsentT< T, I, E >, AlignT< T, I, E >, AllocatorT< T, I, E >, AtomicDefaultMemOrderT< T, I, E >, AtT< T, I, E >, BindT< T, I, E >, CollapseT< T, I, E >, ContainsT< T, I, E >, CopyinT< T, I, E >, CopyprivateT< T, I, E >, DefaultT< T, I, E >, DestroyT< T, I, E >, DetachT< T, I, E >, DeviceTypeT< T, I, E >, EnterT< T, I, E >, ExclusiveT< T, I, E >, FailT< T, I, E >, FilterT< T, I, E >, FinalT< T, I, E >, FirstprivateT< T, I, E >, HasDeviceAddrT< T, I, E >, HintT< T, I, E >, HoldsT< T, I, E >, InclusiveT< T, I, E >, IndirectT< T, I, E >, InitializerT< T, I, E >, IsDevicePtrT< T, I, E >, LinkT< T, I, E >, MessageT< T, I, E >, NocontextT< T, I, E >, NontemporalT< T, I, E >, NovariantsT< T, I, E >, NumTeamsT< T, I, E >, NumThreadsT< T, I, E >, OrderedT< T, I, E >, PartialT< T, I, E >, PriorityT< T, I, E >, PrivateT< T, I, E >, ProcBindT< T, I, E >, SafelenT< T, I, E >, SeverityT< T, I, E >, SharedT< T, I, E >, SimdlenT< T, I, E >, SizesT< T, I, E >, ThreadLimitT< T, I, E >, UniformT< T, I, E >, UpdateT< T, I, E >, UseDeviceAddrT< T, I, E >, UseDevicePtrT< T, I, E >, UsesAllocatorsT< T, I, E > > WrapperClausesT
std::variant< OmpxAttributeT< T, I, E >, OmpxBareT< T, I, E >, OmpxDynCgroupMemT< T, I, E > > ExtensionClausesT
std::variant< AdjustArgsT< T, I, E >, AppendArgsT< T, I, E >, MatchT< T, I, E >, OtherwiseT< T, I, E >, WhenT< T, I, E > > IncompleteClausesT
std::variant< AffinityT< T, I, E >, AlignedT< T, I, E >, AllocateT< T, I, E >, DefaultmapT< T, I, E >, DeviceT< T, I, E >, DistScheduleT< T, I, E >, DoacrossT< T, I, E >, FromT< T, I, E >, GrainsizeT< T, I, E >, IfT< T, I, E >, InitT< T, I, E >, InReductionT< T, I, E >, LastprivateT< T, I, E >, LinearT< T, I, E >, MapT< T, I, E >, NumTasksT< T, I, E >, OrderT< T, I, E >, ReductionT< T, I, E >, ScheduleT< T, I, E >, TaskReductionT< T, I, E >, ToT< T, I, E > > TupleClausesT
llvm::omp::Directive DirectiveName
ListT< ResultTy > makeList(ContainerTy &&container, FunctionTy &&func)
std::variant< Types1..., Types2... > type
static constexpr bool value
std::true_type UnionTrait
typename type::Union< clause::UnionOfAllClausesT< TypeType, IdType, ExprType >, std::variant< Extras... > >::type VariantTy
tomp::type::ListT< ClauseType > clauses
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type IncompleteTrait
std::tuple< OPT(Iterator), LocatorList > t
std::true_type TupleTrait
std::true_type WrapperTrait
std::tuple< OPT(Alignment), List > t
std::true_type TupleTrait
std::true_type TupleTrait
E AllocatorSimpleModifier
std::tuple< OPT(AllocatorSimpleModifier), OPT(AllocatorComplexModifier), OPT(AlignModifier), List > t
std::true_type WrapperTrait
std::true_type IncompleteTrait
ENUM(ActionTime, Compilation, Execution)
std::true_type WrapperTrait
std::true_type WrapperTrait
type::MemoryOrder MemoryOrder
ENUM(Binding, Teams, Parallel, Thread)
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
ENUM(DataSharingAttribute, Firstprivate, None, Private, Shared)
ENUM(VariableCategory, Scalar, Aggregate, Pointer, Allocatable)
ENUM(ImplicitBehavior, Alloc, To, From, Tofrom, Firstprivate, None, Default, Present)
std::tuple< ImplicitBehavior, OPT(VariableCategory)> t
std::true_type TupleTrait
std::true_type TupleTrait
std::tuple< TaskDependenceType, OPT(Iterator), LocatorList > t
std::true_type UnionTrait
tomp::type::TaskDependenceType TaskDependenceType
std::variant< Doacross, WithLocators > u
std::true_type WrapperTrait
std::true_type WrapperTrait
std::tuple< OPT(DeviceModifier), DeviceDescription > t
std::true_type TupleTrait
ENUM(DeviceModifier, Ancestor, DeviceNum)
std::true_type WrapperTrait
ENUM(DeviceTypeDescription, Any, Host, Nohost)
std::tuple< Kind, OPT(ChunkSize)> t
std::true_type TupleTrait
std::true_type TupleTrait
std::tuple< DependenceType, Vector > t
ENUM(DependenceType, Source, Sink)
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
type::MemoryOrder MemoryOrder
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type TupleTrait
std::tuple< OPT(Expectation), OPT(Mappers), OPT(Iterator), LocatorList > t
type::MotionExpectation Expectation
std::true_type EmptyTrait
std::true_type TupleTrait
ENUM(Prescriptiveness, Strict)
std::tuple< OPT(Prescriptiveness), GrainSize > t
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::tuple< OPT(DirectiveNameModifier), IfExpression > t
std::true_type TupleTrait
type::DirectiveName DirectiveNameModifier
std::tuple< ReductionIdentifiers, List > t
std::true_type TupleTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
ListT< InteropType > InteropTypes
std::tuple< OPT(InteropPreference), InteropTypes, InteropVar > t
ENUM(InteropType, Target, Targetsync)
std::true_type TupleTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::tuple< OPT(LastprivateModifier), List > t
ENUM(LastprivateModifier, Conditional)
std::true_type TupleTrait
std::true_type TupleTrait
ENUM(LinearModifier, Ref, Val, Uval)
std::tuple< OPT(StepSimpleModifier), OPT(StepComplexModifier), OPT(LinearModifier), List > t
std::true_type WrapperTrait
ENUM(MapTypeModifier, Always, Close, Present, OmpxHold)
ENUM(MapType, To, From, Tofrom, Alloc, Release, Delete)
std::tuple< OPT(MapType), OPT(MapTypeModifiers), OPT(Mappers), OPT(Iterator), LocatorList > t
std::true_type TupleTrait
std::true_type IncompleteTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::tuple< OPT(Prescriptiveness), NumTasks > t
ENUM(Prescriptiveness, Strict)
std::true_type TupleTrait
std::true_type TupleTrait
std::tuple< OPT(LowerBound), UpperBound > t
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::tuple< OPT(OrderModifier), Ordering > t
ENUM(OrderModifier, Reproducible, Unconstrained)
std::true_type TupleTrait
ENUM(Ordering, Concurrent)
std::true_type WrapperTrait
std::true_type IncompleteTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
ENUM(AffinityPolicy, Close, Master, Spread, Primary)
std::true_type EmptyTrait
std::true_type TupleTrait
std::tuple< OPT(ReductionModifier), ReductionIdentifiers, List > t
ENUM(ReductionModifier, Default, Inscan, Task)
ListT< type::ReductionIdentifierT< I, E > > ReductionIdentifiers
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type TupleTrait
std::tuple< Kind, OPT(OrderingModifier), OPT(ChunkModifier), OPT(ChunkSize)> t
ENUM(OrderingModifier, Monotonic, Nonmonotonic)
ENUM(ChunkModifier, Simd)
ENUM(Kind, Static, Dynamic, Guided, Auto, Runtime)
std::true_type EmptyTrait
ENUM(SevLevel, Fatal, Warning)
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type TupleTrait
std::tuple< ReductionIdentifiers, List > t
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type TupleTrait
type::MotionExpectation Expectation
std::tuple< OPT(Expectation), OPT(Mappers), OPT(Iterator), LocatorList > t
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
OPT(TaskDependenceType) v
tomp::type::TaskDependenceType TaskDependenceType
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::tuple< OPT(MemSpace), OPT(TraitsArray), Allocator > t
std::true_type TupleTrait
std::true_type WrapperTrait
std::true_type EmptyTrait
std::true_type IncompleteTrait
std::true_type EmptyTrait
std::true_type WrapperTrait
std::true_type UnionTrait
std::variant< DefinedOpName, IntrinsicOperator > u
ENUM(IntrinsicOperator, Power, Multiply, Divide, Add, Subtract, Concat, LT, LE, EQ, NE, GE, GT, NOT, AND, OR, EQV, NEQV, Min, Max)
std::true_type TupleTrait
std::tuple< OPT(TypeType), ObjectT< IdType, ExprType >, RangeT< ExprType > > t
std::tuple< DefinedOperatorT< I, E >, E > t
std::true_type TupleTrait
std::tuple< ObjectT< I, E >, OPT(Distance)> t
std::true_type TupleTrait
std::true_type WrapperTrait
std::true_type WrapperTrait
std::true_type TupleTrait
std::tuple< E, E, OPT(E)> t
std::true_type UnionTrait
std::variant< DefinedOperatorT< I, E >, ProcedureDesignatorT< I, E > > u
typename detail::UnionOfTwo< T, typename Union< Ts... >::type >::type type