brintos

brintos / llvm-project-archived public Read only

0
0
Text · 916 B · 3edcb09 Raw
25 lines · cpp
1//===- RegisterEverything.cpp - API to register all dialects/passes -------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "mlir-c/RegisterEverything.h"10#include "mlir/Bindings/Python/Nanobind.h"11#include "mlir/Bindings/Python/NanobindAdaptors.h"12 13NB_MODULE(_mlirRegisterEverything, m) {14  m.doc() = "MLIR All Upstream Dialects, Translations and Passes Registration";15 16  m.def("register_dialects", [](MlirDialectRegistry registry) {17    mlirRegisterAllDialects(registry);18  });19  m.def("register_llvm_translations",20        [](MlirContext context) { mlirRegisterAllLLVMTranslations(context); });21 22  // Register all passes on load.23  mlirRegisterAllPasses();24}25