LLVM 24.0.0git
OMPDescriptors.cpp
Go to the documentation of this file.
1//===-- OMPDescriptors.cpp - OpenMP descriptors ------------------- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains descriptors of OpenMP elements.
10//
11//===----------------------------------------------------------------------===//
12
14
15namespace llvm::omp {
18#define GEN_OMP_CLAUSE_DESCRIPTORS
19#include "OMPDescriptors.inc"
20#undef GEN_OMP_CLAUSE_DESCRIPTORS
21 };
22 return Map;
23}
24
27#define GEN_OMP_MODIFIER_DESCRIPTORS
28#include "OMPDescriptors.inc"
29#undef GEN_OMP_MODIFIER_DESCRIPTORS
30 };
31 return Map;
32}
33
36#define GEN_OMP_MODIFIER_GROUP_DESCRIPTORS
37#include "OMPDescriptors.inc"
38#undef GEN_OMP_MODIFIER_GROUP_DESCRIPTORS
39
40#define GEN_OMP_MODIFIER_SET_DESCRIPTORS
41#include "OMPDescriptors.inc"
42#undef GEN_OMP_MODIFIER_SET_DESCRIPTORS
43 };
44 return Map;
45}
46
47#define GET_THING_OR_EMPTY(Thing, Member) \
48 template <typename DetailsTy> \
49 static Thing get##Thing##OrEmpty(const DetailsTy &D, Version V) { \
50 V = std::max(V, Version(45)); \
51 if (auto Found = D.find(V); Found != D.end()) \
52 return Found->second.Member; \
53 return Thing{}; \
54 }
55
61
62#undef GET_THING_OR_EMPTY
63
64// Clause
66 return getPropertiesOrEmpty(Details, V);
67}
69 return getDirectivesOrEmpty(Details, V);
70}
72 return getModifiersOrEmpty(Details, V);
73}
75 return getModifierSetsOrEmpty(Details, V);
76}
77// Modifier
79 return getPropertiesOrEmpty(Details, V);
80}
82 return getClausesOrEmpty(Details, V);
83}
84// ModifierSet
86 return getPropertiesOrEmpty(Details, V);
87}
89 return getModifiersOrEmpty(Details, V);
90}
92 return getClausesOrEmpty(Details, V);
93}
94
95const descriptor::Clause &getDescriptor(llvm::omp::Clause C) {
96 return getClauseMap().at(C);
97}
104
106 return getDescriptor(C).getProperties(std::max(V, Version(45)));
107}
108} // namespace llvm::omp
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define GET_THING_OR_EMPTY(Thing, Member)
EnumSet< Modifier, Modifier_enumSize > Modifiers
LLVM_ABI const descriptor::Clause & getDescriptor(llvm::omp::Clause C)
llvm::omp::ClauseSet Clauses
const DescriptorMap< Clause, descriptor::Clause > & getClauseMap()
EnumSet< Property, Property_enumSize > Properties
EnumSet< ModifierSet, ModifierSet_enumSize > ModifierSets
DenseMap< Enum, DescriptorTy > DescriptorMap
LLVM_ABI Properties getProperties(Clause C, Version V)
const DescriptorMap< ModifierSet, descriptor::ModifierSet > & getModifierSetMap()
const DescriptorMap< Modifier, descriptor::Modifier > & getModifierMap()
llvm::omp::DirectiveSet Directives
LLVM_ABI Modifiers getModifiers(Version V) const
LLVM_ABI ModifierSets getModifierSets(Version V) const
LLVM_ABI Directives getDirectives(Version V) const
LLVM_ABI Properties getProperties(Version V) const
LLVM_ABI Clauses getClauses(Version V) const
LLVM_ABI Modifiers getModifiers(Version V) const
LLVM_ABI Properties getProperties(Version V) const
LLVM_ABI Clauses getClauses(Version V) const
LLVM_ABI Properties getProperties(Version V) const