clang
23.0.0git
lib
CIR
Dialect
OpenMP
RegisterOpenMPExtensions.cpp
Go to the documentation of this file.
1
//===----------------------------------------------------------------------===//
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 OpenMP extensions as applied to CIR dialect.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "
clang/CIR/Dialect/OpenMP/RegisterOpenMPExtensions.h
"
14
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
15
#include "mlir/Dialect/OpenMP/OpenMPInterfaces.h"
16
#include "
clang/CIR/Dialect/IR/CIRDialect.h
"
17
#include "
clang/CIR/Dialect/IR/CIRTypes.h
"
18
19
namespace
{
20
struct
OpenMPPointerLikeModel
21
:
public
mlir::omp::PointerLikeType::ExternalModel<OpenMPPointerLikeModel,
22
cir::PointerType> {
23
mlir::Type getElementType(mlir::Type pointer)
const
{
24
return
mlir::cast<cir::PointerType>(pointer).getPointee();
25
}
26
};
27
}
// namespace
28
29
namespace
cir::omp
{
30
31
void
registerOpenMPExtensions
(mlir::DialectRegistry ®istry) {
32
registry.addExtension(+[](mlir::MLIRContext *ctx, cir::CIRDialect *dialect) {
33
cir::FuncOp::attachInterface<
34
mlir::omp::DeclareTargetDefaultModel<cir::FuncOp>>(*ctx);
35
cir::PointerType::attachInterface<OpenMPPointerLikeModel>(*ctx);
36
});
37
}
38
39
}
// namespace cir::omp
CIRDialect.h
CIRTypes.h
RegisterOpenMPExtensions.h
cir::omp
Definition
RegisterOpenMPExtensions.h:16
cir::omp::registerOpenMPExtensions
void registerOpenMPExtensions(mlir::DialectRegistry ®istry)
Definition
RegisterOpenMPExtensions.cpp:31
Generated on
for clang by
1.14.0