Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:55

0001 //===-- OMP.h - Core OpenMP definitions and declarations ---------- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file contains the core set of OpenMP definitions and declarations.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_FRONTEND_OPENMP_OMP_H
0014 #define LLVM_FRONTEND_OPENMP_OMP_H
0015 
0016 #include "llvm/Frontend/OpenMP/OMP.h.inc"
0017 
0018 #include "llvm/ADT/ArrayRef.h"
0019 #include "llvm/ADT/SmallVector.h"
0020 #include "llvm/ADT/StringRef.h"
0021 
0022 namespace llvm::omp {
0023 ArrayRef<Directive> getLeafConstructs(Directive D);
0024 ArrayRef<Directive> getLeafConstructsOrSelf(Directive D);
0025 
0026 ArrayRef<Directive>
0027 getLeafOrCompositeConstructs(Directive D, SmallVectorImpl<Directive> &Output);
0028 
0029 Directive getCompoundConstruct(ArrayRef<Directive> Parts);
0030 
0031 bool isLeafConstruct(Directive D);
0032 bool isCompositeConstruct(Directive D);
0033 bool isCombinedConstruct(Directive D);
0034 
0035 /// Can clause C have an iterator-modifier.
0036 static constexpr inline bool canHaveIterator(Clause C) {
0037   // [5.2:67:5]
0038   switch (C) {
0039   case OMPC_affinity:
0040   case OMPC_depend:
0041   case OMPC_from:
0042   case OMPC_map:
0043   case OMPC_to:
0044     return true;
0045   default:
0046     return false;
0047   }
0048 }
0049 
0050 ArrayRef<unsigned> getOpenMPVersions();
0051 
0052 /// Create a nicer version of a function name for humans to look at.
0053 std::string prettifyFunctionName(StringRef FunctionName);
0054 
0055 /// Deconstruct an OpenMP kernel name into the parent function name and the line
0056 /// number.
0057 std::string deconstructOpenMPKernelName(StringRef KernelName, unsigned &LineNo);
0058 
0059 } // namespace llvm::omp
0060 
0061 #endif // LLVM_FRONTEND_OPENMP_OMP_H