15e83a5b4SStella Laurenzo //===- RegisterEverything.cpp - Register all MLIR entities ----------------===// 25e83a5b4SStella Laurenzo // 35e83a5b4SStella Laurenzo // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 45e83a5b4SStella Laurenzo // See https://llvm.org/LICENSE.txt for license information. 55e83a5b4SStella Laurenzo // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 65e83a5b4SStella Laurenzo // 75e83a5b4SStella Laurenzo //===----------------------------------------------------------------------===// 85e83a5b4SStella Laurenzo 95e83a5b4SStella Laurenzo #include "mlir-c/RegisterEverything.h" 105e83a5b4SStella Laurenzo 115e83a5b4SStella Laurenzo #include "mlir/CAPI/IR.h" 12*7c4e8c6aSNicolas Vasilache #include "mlir/IR/MLIRContext.h" 135e83a5b4SStella Laurenzo #include "mlir/InitAllDialects.h" 14120cd5aaSAshay Rane #include "mlir/InitAllExtensions.h" 155e83a5b4SStella Laurenzo #include "mlir/InitAllPasses.h" 16*7c4e8c6aSNicolas Vasilache #include "mlir/Target/LLVMIR/Dialect/All.h" 170e9523efSSergio Afonso #include "mlir/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.h" 185e83a5b4SStella Laurenzo #include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h" 195e83a5b4SStella Laurenzo mlirRegisterAllDialects(MlirDialectRegistry registry)205e83a5b4SStella Laurenzovoid mlirRegisterAllDialects(MlirDialectRegistry registry) { 215e83a5b4SStella Laurenzo mlir::registerAllDialects(*unwrap(registry)); 22120cd5aaSAshay Rane mlir::registerAllExtensions(*unwrap(registry)); 235e83a5b4SStella Laurenzo } 245e83a5b4SStella Laurenzo mlirRegisterAllLLVMTranslations(MlirContext context)255e83a5b4SStella Laurenzovoid mlirRegisterAllLLVMTranslations(MlirContext context) { 260e9523efSSergio Afonso auto &ctx = *unwrap(context); 27*7c4e8c6aSNicolas Vasilache mlir::DialectRegistry registry; 28*7c4e8c6aSNicolas Vasilache mlir::registerAllToLLVMIRTranslations(registry); 29*7c4e8c6aSNicolas Vasilache ctx.appendDialectRegistry(registry); 305e83a5b4SStella Laurenzo } 315e83a5b4SStella Laurenzo mlirRegisterAllPasses()325e83a5b4SStella Laurenzovoid mlirRegisterAllPasses() { mlir::registerAllPasses(); } 33