|
| 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 | +// Defines the interface to link CIR dialect. |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +#include "clang/CIR/Interfaces/CIRLinkerInterface.h" |
| 14 | +#include "mlir/Linker/LinkerInterface.h" |
| 15 | +#include "clang/CIR/Dialect/IR/CIRDialect.h" |
| 16 | + |
| 17 | +using namespace mlir; |
| 18 | +using namespace mlir::link; |
| 19 | + |
| 20 | +//===----------------------------------------------------------------------===// |
| 21 | +// CIRSymbolLinkerInterface |
| 22 | +//===----------------------------------------------------------------------===// |
| 23 | + |
| 24 | +class CIRSymbolLinkerInterface : public SymbolLinkerInterface { |
| 25 | +public: |
| 26 | + using SymbolLinkerInterface::SymbolLinkerInterface; |
| 27 | + |
| 28 | + bool canBeLinked(Operation *op) const override { llvm_unreachable("NYI"); } |
| 29 | + |
| 30 | + StringRef getSymbol(Operation *op) const override { llvm_unreachable("NYI"); } |
| 31 | + |
| 32 | + Conflict findConflict(Operation *src) const override { |
| 33 | + llvm_unreachable("NYI"); |
| 34 | + } |
| 35 | + |
| 36 | + bool isLinkNeeded(Conflict pair, bool forDependency) const override { |
| 37 | + llvm_unreachable("NYI"); |
| 38 | + } |
| 39 | + |
| 40 | + LogicalResult resolveConflict(Conflict pair) override { |
| 41 | + llvm_unreachable("NYI"); |
| 42 | + } |
| 43 | + |
| 44 | + void registerForLink(Operation *op) override { llvm_unreachable("NYI"); } |
| 45 | + |
| 46 | + LogicalResult initialize(ModuleOp src) override { return success(); } |
| 47 | + |
| 48 | + LogicalResult link(LinkState &state) const override { |
| 49 | + llvm_unreachable("NYI"); |
| 50 | + } |
| 51 | + |
| 52 | + Operation *materialize(Operation *src, LinkState &state) const override { |
| 53 | + llvm_unreachable("NYI"); |
| 54 | + } |
| 55 | + |
| 56 | + SmallVector<Operation *> dependencies(Operation *op) const override { |
| 57 | + llvm_unreachable("NYI"); |
| 58 | + } |
| 59 | +}; |
| 60 | + |
| 61 | +//===----------------------------------------------------------------------===// |
| 62 | +// registerLinkerInterface |
| 63 | +//===----------------------------------------------------------------------===// |
| 64 | + |
| 65 | +void cir::registerLinkerInterface(mlir::DialectRegistry ®istry) { |
| 66 | + registry.addExtension(+[](mlir::MLIRContext *ctx, cir::CIRDialect *dialect) { |
| 67 | + dialect->addInterfaces<CIRSymbolLinkerInterface>(); |
| 68 | + }); |
| 69 | +} |
0 commit comments