diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | llvm/lib/Frontend/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | llvm/lib/Frontend/LLVMBuild.txt | 23 | ||||
| -rw-r--r-- | llvm/lib/Frontend/OpenMP/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | llvm/lib/Frontend/OpenMP/LLVMBuild.txt | 21 | ||||
| -rw-r--r-- | llvm/lib/Frontend/OpenMP/OMPConstants.cpp | 34 | ||||
| -rw-r--r-- | llvm/lib/LLVMBuild.txt | 1 |
7 files changed, 91 insertions, 0 deletions
diff --git a/llvm/lib/CMakeLists.txt b/llvm/lib/CMakeLists.txt index 5a41d65b0cf..f7e08a68e67 100644 --- a/llvm/lib/CMakeLists.txt +++ b/llvm/lib/CMakeLists.txt @@ -8,6 +8,7 @@ add_subdirectory(CodeGen) add_subdirectory(BinaryFormat) add_subdirectory(Bitcode) add_subdirectory(Bitstream) +add_subdirectory(Frontend) add_subdirectory(Transforms) add_subdirectory(Linker) add_subdirectory(Analysis) diff --git a/llvm/lib/Frontend/CMakeLists.txt b/llvm/lib/Frontend/CMakeLists.txt new file mode 100644 index 00000000000..9730c8414ed --- /dev/null +++ b/llvm/lib/Frontend/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(OpenMP) diff --git a/llvm/lib/Frontend/LLVMBuild.txt b/llvm/lib/Frontend/LLVMBuild.txt new file mode 100644 index 00000000000..78ec6ae5186 --- /dev/null +++ b/llvm/lib/Frontend/LLVMBuild.txt @@ -0,0 +1,23 @@ +;===- ./lib/Frontend/LLVMBuild.txt -----------------------------*- Conf -*--===; +; +; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +; See https://llvm.org/LICENSE.txt for license information. +; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +; +;===------------------------------------------------------------------------===; +; +; This is an LLVMBuild description file for the components in this subdirectory. +; +; For more information on the LLVMBuild system, please see: +; +; http://llvm.org/docs/LLVMBuild.html +; +;===------------------------------------------------------------------------===; + +[common] +subdirectories = OpenMP + +[component_0] +type = Group +name = Frontend +parent = Libraries diff --git a/llvm/lib/Frontend/OpenMP/CMakeLists.txt b/llvm/lib/Frontend/OpenMP/CMakeLists.txt new file mode 100644 index 00000000000..5d74bcf3b9f --- /dev/null +++ b/llvm/lib/Frontend/OpenMP/CMakeLists.txt @@ -0,0 +1,10 @@ +add_llvm_component_library(LLVMFrontendOpenMP + OMPConstants.cpp + + ADDITIONAL_HEADER_DIRS + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Frontend + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Frontend/OpenMP + + DEPENDS + intrinsics_gen + ) diff --git a/llvm/lib/Frontend/OpenMP/LLVMBuild.txt b/llvm/lib/Frontend/OpenMP/LLVMBuild.txt new file mode 100644 index 00000000000..dfabe72fcd2 --- /dev/null +++ b/llvm/lib/Frontend/OpenMP/LLVMBuild.txt @@ -0,0 +1,21 @@ +;===- ./lib/Frontend/OpenMP/LLVMBuild.txt ----------------------*- Conf -*--===; +; +; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +; See https://llvm.org/LICENSE.txt for license information. +; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +; +;===------------------------------------------------------------------------===; +; +; This is an LLVMBuild description file for the components in this subdirectory. +; +; For more information on the LLVMBuild system, please see: +; +; http://llvm.org/docs/LLVMBuild.html +; +;===------------------------------------------------------------------------===; + +[component_0] +type = Library +name = FrontendOpenMP +parent = Frontend +required_libraries = Core Support TransformUtils diff --git a/llvm/lib/Frontend/OpenMP/OMPConstants.cpp b/llvm/lib/Frontend/OpenMP/OMPConstants.cpp new file mode 100644 index 00000000000..994fb4e2fa8 --- /dev/null +++ b/llvm/lib/Frontend/OpenMP/OMPConstants.cpp @@ -0,0 +1,34 @@ +//===- OMPConstants.cpp - Helpers related to OpenMP code generation ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +//===----------------------------------------------------------------------===// + +#include "llvm/Frontend/OpenMP/OMPConstants.h" + +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSwitch.h" + +using namespace llvm; +using namespace omp; + +Directive llvm::omp::getOpenMPDirectiveKind(StringRef Str) { + return llvm::StringSwitch<Directive>(Str) +#define OMP_DIRECTIVE(Enum, Str) .Case(Str, Enum) +#include "llvm/Frontend/OpenMP/OMPKinds.def" + .Default(OMPD_unknown); +} + +StringRef llvm::omp::getOpenMPDirectiveName(Directive Kind) { + switch (Kind) { +#define OMP_DIRECTIVE(Enum, Str) \ + case Enum: \ + return Str; +#include "llvm/Frontend/OpenMP/OMPKinds.def" + } + llvm_unreachable("Invalid OpenMP directive kind"); +} diff --git a/llvm/lib/LLVMBuild.txt b/llvm/lib/LLVMBuild.txt index 4c039176267..3f5383d9b1f 100644 --- a/llvm/lib/LLVMBuild.txt +++ b/llvm/lib/LLVMBuild.txt @@ -24,6 +24,7 @@ subdirectories = DebugInfo Demangle ExecutionEngine + Frontend FuzzMutate LineEditor Linker |

