1 | //===- RegisterEverything.cpp - Register all MLIR entities ----------------===// |
---|---|
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 | #include "mlir-c/RegisterEverything.h" |
10 | |
11 | #include "mlir/CAPI/IR.h" |
12 | #include "mlir/IR/MLIRContext.h" |
13 | #include "mlir/InitAllDialects.h" |
14 | #include "mlir/InitAllExtensions.h" |
15 | #include "mlir/InitAllPasses.h" |
16 | #include "mlir/Target/LLVMIR/Dialect/All.h" |
17 | #include "mlir/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.h" |
18 | #include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h" |
19 | |
20 | void mlirRegisterAllDialects(MlirDialectRegistry registry) { |
21 | mlir::registerAllDialects(registry&: *unwrap(c: registry)); |
22 | mlir::registerAllExtensions(registry&: *unwrap(c: registry)); |
23 | } |
24 | |
25 | void mlirRegisterAllLLVMTranslations(MlirContext context) { |
26 | auto &ctx = *unwrap(c: context); |
27 | mlir::DialectRegistry registry; |
28 | mlir::registerAllToLLVMIRTranslations(registry); |
29 | ctx.appendDialectRegistry(registry); |
30 | } |
31 | |
32 | void mlirRegisterAllPasses() { mlir::registerAllPasses(); } |
33 |