1//===-- RegisterOpenACCExtensions.cpp -------------------------------------===//
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// Registration for OpenACC extensions as applied to FIR dialect.
10//
11//===----------------------------------------------------------------------===//
12
13#include "flang/Optimizer/OpenACC/Support/RegisterOpenACCExtensions.h"
14#include "flang/Optimizer/Dialect/FIRDialect.h"
15#include "flang/Optimizer/Dialect/FIRType.h"
16#include "flang/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.h"
17
18namespace fir::acc {
19void registerOpenACCExtensions(mlir::DialectRegistry &registry) {
20 registry.addExtension(+[](mlir::MLIRContext *ctx,
21 fir::FIROpsDialect *dialect) {
22 fir::BoxType::attachInterface<OpenACCMappableModel<fir::BaseBoxType>>(*ctx);
23 fir::ClassType::attachInterface<OpenACCMappableModel<fir::BaseBoxType>>(
24 *ctx);
25 fir::ReferenceType::attachInterface<
26 OpenACCMappableModel<fir::ReferenceType>>(*ctx);
27 fir::PointerType::attachInterface<OpenACCMappableModel<fir::PointerType>>(
28 *ctx);
29 fir::HeapType::attachInterface<OpenACCMappableModel<fir::HeapType>>(*ctx);
30
31 fir::ReferenceType::attachInterface<
32 OpenACCPointerLikeModel<fir::ReferenceType>>(*ctx);
33 fir::PointerType::attachInterface<
34 OpenACCPointerLikeModel<fir::PointerType>>(*ctx);
35 fir::HeapType::attachInterface<OpenACCPointerLikeModel<fir::HeapType>>(
36 *ctx);
37
38 fir::LLVMPointerType::attachInterface<
39 OpenACCPointerLikeModel<fir::LLVMPointerType>>(*ctx);
40 });
41 registerAttrsExtensions(registry);
42}
43
44} // namespace fir::acc
45

source code of flang/lib/Optimizer/OpenACC/Support/RegisterOpenACCExtensions.cpp