Warning: This file is not a C or C++ file. It does not have highlighting.

1//===-- Tools/PointerModels.h --------------------- *-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#ifndef FORTRAN_TOOLS_POINTER_MODELS_H
10#define FORTRAN_TOOLS_POINTER_MODELS_H
11
12#include "mlir/Dialect/OpenACC/OpenACC.h"
13#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
14
15/// models for FIR pointer like types that already provide a `getElementType`
16/// method
17
18template <typename T>
19struct OpenMPPointerLikeModel
20 : public mlir::omp::PointerLikeType::ExternalModel<
21 OpenMPPointerLikeModel<T>, T> {
22 mlir::Type getElementType(mlir::Type pointer) const {
23 return pointer.cast<T>().getElementType();
24 }
25};
26
27template <typename T>
28struct OpenACCPointerLikeModel
29 : public mlir::acc::PointerLikeType::ExternalModel<
30 OpenACCPointerLikeModel<T>, T> {
31 mlir::Type getElementType(mlir::Type pointer) const {
32 return pointer.cast<T>().getElementType();
33 }
34};
35
36#endif // FORTRAN_TOOLS_POINTER_MODELS_H
37

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of flang/include/flang/Tools/PointerModels.h