clang 20.0.0git
CIRBaseBuilder.h
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#ifndef LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
10#define LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
11
12#include "mlir/IR/Builders.h"
13
14namespace cir {
15
16class CIRBaseBuilderTy : public mlir::OpBuilder {
17
18public:
19 CIRBaseBuilderTy(mlir::MLIRContext &mlirContext)
20 : mlir::OpBuilder(&mlirContext) {}
21
22 cir::PointerType getPointerTo(mlir::Type ty) {
23 return cir::PointerType::get(getContext(), ty);
24 }
25
26 cir::PointerType getVoidPtrTy() {
27 return getPointerTo(cir::VoidType::get(getContext()));
28 }
29};
30
31} // namespace cir
32
33#endif
cir::PointerType getPointerTo(mlir::Type ty)
CIRBaseBuilderTy(mlir::MLIRContext &mlirContext)
cir::PointerType getVoidPtrTy()