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
15#include "llvm/ADT/DenseMap.h"
17
18namespace llvm::omp {
21#define GEN_OMP_CLAUSE_DESCRIPTORS
22#include "OMPDescriptors.inc"
23#undef GEN_OMP_CLAUSE_DESCRIPTORS
24 };
25 return Map;
26}
27
30#define GEN_OMP_MODIFIER_DESCRIPTORS
31#include "OMPDescriptors.inc"
32#undef GEN_OMP_MODIFIER_DESCRIPTORS
33 };
34 return Map;
35}
36
37#define GET_THING_OR_EMPTY(Thing, Member) \
38 template <typename DetailsTy> \
39 static Thing get##Thing##OrEmpty(const DetailsTy &D, unsigned V) { \
40 V = std::max(V, 45u); \
41 if (auto Found = D.find(V); Found != D.end()) \
42 return Found->second.Member; \
43 return Thing{}; \
44 }
45
50
51#undef GET_THING_OR_EMPTY
52
54 return getPropertiesOrEmpty(Details, V);
55}
57 return getDirectivesOrEmpty(Details, V);
58}
60 return getModifiersOrEmpty(Details, V);
61}
63 return getPropertiesOrEmpty(Details, V);
64}
66 return getClausesOrEmpty(Details, V);
67}
68
69const descriptor::Clause &getDescriptor(llvm::omp::Clause C) {
70 return getClauseMap().at(C);
71}
72
76
78 return getDescriptor(C).getProperties(std::max(Version, 45u));
79}
80} // namespace llvm::omp
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
This file defines the DenseMap class.
#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
LLVM_ABI Properties getProperties(Clause C, unsigned Version)
DenseMap< Enum, DescriptorTy > DescriptorMap
const DescriptorMap< Modifier, descriptor::Modifier > & getModifierMap()
llvm::omp::DirectiveSet Directives
LLVM_ABI Properties getProperties(unsigned V) const
LLVM_ABI Modifiers getModifiers(unsigned V) const
LLVM_ABI Directives getDirectives(unsigned V) const
LLVM_ABI Clauses getClauses(unsigned V) const
LLVM_ABI Properties getProperties(unsigned V) const