|
| 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 | +// This file implements the main function for cir-link, a tool to link CIR |
| 10 | +// modules: cir-link a.mlir b.mlir c.mlir -o x.mlir |
| 11 | +// |
| 12 | +//===----------------------------------------------------------------------===// |
| 13 | + |
| 14 | +#include "mlir/Dialect/DLTI/DLTI.h" |
| 15 | +#include "mlir/IR/BuiltinDialect.h" |
| 16 | +#include "mlir/IR/Dialect.h" |
| 17 | +#include "mlir/IR/MLIRContext.h" |
| 18 | +#include "mlir/Tools/mlir-link/MlirLinkMain.h" |
| 19 | +#include "mlir/IR/BuiltinLinkerInterface.h" |
| 20 | +#include "clang/CIR/Dialect/IR/CIRDialect.h" |
| 21 | +#include "clang/CIR/Interfaces/CIRLinkerInterface.h" |
| 22 | + |
| 23 | +using namespace mlir; |
| 24 | + |
| 25 | +int main(int argc, char **argv) { |
| 26 | + DialectRegistry registry; |
| 27 | + registry.insert<mlir::BuiltinDialect, cir::CIRDialect, mlir::DLTIDialect>(); |
| 28 | + builtin::registerLinkerInterface(registry); |
| 29 | + cir::registerLinkerInterface(registry); |
| 30 | + |
| 31 | + return failed(MlirLinkMain(argc, argv, registry)); |
| 32 | +} |
0 commit comments