| 1 | //===- LoweringPrepare.cpp - pareparation work for LLVM lowering ----------===// |
| 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 "PassDetail.h" |
| 10 | #include "clang/AST/ASTContext.h" |
| 11 | #include "clang/CIR/Dialect/IR/CIRDialect.h" |
| 12 | #include "clang/CIR/Dialect/Passes.h" |
| 13 | |
| 14 | #include <memory> |
| 15 | |
| 16 | using namespace mlir; |
| 17 | using namespace cir; |
| 18 | |
| 19 | namespace { |
| 20 | struct LoweringPreparePass : public LoweringPrepareBase<LoweringPreparePass> { |
| 21 | LoweringPreparePass() = default; |
| 22 | void runOnOperation() override; |
| 23 | |
| 24 | void runOnOp(Operation *op); |
| 25 | }; |
| 26 | |
| 27 | } // namespace |
| 28 | |
| 29 | void LoweringPreparePass::runOnOp(Operation *op) {} |
| 30 | |
| 31 | void LoweringPreparePass::runOnOperation() { |
| 32 | llvm::SmallVector<Operation *> opsToTransform; |
| 33 | |
| 34 | for (auto *o : opsToTransform) |
| 35 | runOnOp(op: o); |
| 36 | } |
| 37 | |
| 38 | std::unique_ptr<Pass> mlir::createLoweringPreparePass() { |
| 39 | return std::make_unique<LoweringPreparePass>(); |
| 40 | } |
| 41 | |