1 //===- OpenMPCommon.h - Utils for translating MLIR dialect to LLVM IR------===// 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 defines general utilities for MLIR Dialect translations to LLVM IR. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef MLIR_TARGET_LLVMIR_DIALECT_OPENMPCOMMON_H 14 #define MLIR_TARGET_LLVMIR_DIALECT_OPENMPCOMMON_H 15 16 #include "mlir/IR/BuiltinAttributes.h" 17 #include "mlir/IR/Location.h" 18 #include "mlir/Support/LLVM.h" 19 20 #include "llvm/Frontend/OpenMP/OMPIRBuilder.h" 21 #include "llvm/IR/IRBuilder.h" 22 23 namespace mlir { 24 namespace LLVM { 25 26 /// Create a constant string location from the MLIR Location information. 27 llvm::Constant *createSourceLocStrFromLocation(Location loc, 28 llvm::OpenMPIRBuilder &builder, 29 StringRef name, 30 uint32_t &strLen); 31 32 /// Create a constant string representing the mapping information extracted from 33 /// the MLIR location information. 34 llvm::Constant *createMappingInformation(Location loc, 35 llvm::OpenMPIRBuilder &builder); 36 37 } // namespace LLVM 38 } // namespace mlir 39 40 #endif // MLIR_TARGET_LLVMIR_DIALECT_OPENMPCOMMON_H 41