1 //===- OpenMPDialect.cpp - MLIR Dialect for OpenMP implementation ---------===// 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 implements the OpenMP dialect and its operations. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "mlir/Dialect/OpenMP/OpenMPDialect.h" 14 #include "mlir/Dialect/StandardOps/IR/Ops.h" 15 #include "mlir/IR/OpImplementation.h" 16 17 #include "llvm/ADT/StringSwitch.h" 18 19 #include "mlir/Dialect/OpenMP/OpenMPOpsEnums.cpp.inc" 20 21 using namespace mlir; 22 using namespace mlir::omp; 23 24 OpenMPDialect::OpenMPDialect(MLIRContext *context) 25 : Dialect(getDialectNamespace(), context) { 26 addOperations< 27 #define GET_OP_LIST 28 #include "mlir/Dialect/OpenMP/OpenMPOps.cpp.inc" 29 >(); 30 } 31 32 namespace mlir { 33 namespace omp { 34 #define GET_OP_CLASSES 35 #include "mlir/Dialect/OpenMP/OpenMPOps.cpp.inc" 36 } // namespace omp 37 } // namespace mlir 38