LLVM 20.0.0git
OMP.h
Go to the documentation of this file.
1//===-- OMP.h - Core OpenMP definitions and declarations ---------- 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 the core set of OpenMP definitions and declarations.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_FRONTEND_OPENMP_OMP_H
14#define LLVM_FRONTEND_OPENMP_OMP_H
15
16#include "llvm/Frontend/OpenMP/OMP.h.inc"
17
18#include "llvm/ADT/ArrayRef.h"
20#include "llvm/ADT/StringRef.h"
21
22namespace llvm::omp {
25
28
30
34
35/// Can clause C have an iterator-modifier.
36static constexpr inline bool canHaveIterator(Clause C) {
37 // [5.2:67:5]
38 switch (C) {
39 case OMPC_affinity:
40 case OMPC_depend:
41 case OMPC_from:
42 case OMPC_map:
43 case OMPC_to:
44 return true;
45 default:
46 return false;
47 }
48}
49
51
52/// Create a nicer version of a function name for humans to look at.
53std::string prettifyFunctionName(StringRef FunctionName);
54
55/// Deconstruct an OpenMP kernel name into the parent function name and the line
56/// number.
57std::string deconstructOpenMPKernelName(StringRef KernelName, unsigned &LineNo);
58
59} // namespace llvm::omp
60
61#endif // LLVM_FRONTEND_OPENMP_OMP_H
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:573
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
Definition: OMP.h:22
ArrayRef< unsigned > getOpenMPVersions()
Definition: OMP.cpp:192
bool isCombinedConstruct(Directive D)
Definition: OMP.cpp:186
std::string deconstructOpenMPKernelName(StringRef KernelName, unsigned &LineNo)
Deconstruct an OpenMP kernel name into the parent function name and the line number.
Definition: OMP.cpp:211
ArrayRef< Directive > getLeafOrCompositeConstructs(Directive D, SmallVectorImpl< Directive > &Output)
Definition: OMP.cpp:98
static constexpr bool canHaveIterator(Clause C)
Can clause C have an iterator-modifier.
Definition: OMP.h:36
bool isCompositeConstruct(Directive D)
Definition: OMP.cpp:178
Directive getCompoundConstruct(ArrayRef< Directive > Parts)
Definition: OMP.cpp:125
bool isLeafConstruct(Directive D)
Definition: OMP.cpp:176
ArrayRef< Directive > getLeafConstructsOrSelf(Directive D)
Definition: OMP.cpp:87
std::string prettifyFunctionName(StringRef FunctionName)
Create a nicer version of a function name for humans to look at.
Definition: OMP.cpp:197
ArrayRef< Directive > getLeafConstructs(Directive D)
Definition: OMP.cpp:79