xref: /freebsd/contrib/llvm-project/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp (revision 700637cbb5e582861067a11aaca4d053546871d2)
1*700637cbSDimitry Andric //===- LoweringPrepare.cpp - pareparation work for LLVM lowering ----------===//
2*700637cbSDimitry Andric //
3*700637cbSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*700637cbSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*700637cbSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*700637cbSDimitry Andric //
7*700637cbSDimitry Andric //===----------------------------------------------------------------------===//
8*700637cbSDimitry Andric 
9*700637cbSDimitry Andric #include "PassDetail.h"
10*700637cbSDimitry Andric #include "clang/AST/ASTContext.h"
11*700637cbSDimitry Andric #include "clang/CIR/Dialect/IR/CIRDialect.h"
12*700637cbSDimitry Andric #include "clang/CIR/Dialect/Passes.h"
13*700637cbSDimitry Andric 
14*700637cbSDimitry Andric #include <memory>
15*700637cbSDimitry Andric 
16*700637cbSDimitry Andric using namespace mlir;
17*700637cbSDimitry Andric using namespace cir;
18*700637cbSDimitry Andric 
19*700637cbSDimitry Andric namespace {
20*700637cbSDimitry Andric struct LoweringPreparePass : public LoweringPrepareBase<LoweringPreparePass> {
21*700637cbSDimitry Andric   LoweringPreparePass() = default;
22*700637cbSDimitry Andric   void runOnOperation() override;
23*700637cbSDimitry Andric 
24*700637cbSDimitry Andric   void runOnOp(Operation *op);
25*700637cbSDimitry Andric };
26*700637cbSDimitry Andric 
27*700637cbSDimitry Andric } // namespace
28*700637cbSDimitry Andric 
runOnOp(Operation * op)29*700637cbSDimitry Andric void LoweringPreparePass::runOnOp(Operation *op) {}
30*700637cbSDimitry Andric 
runOnOperation()31*700637cbSDimitry Andric void LoweringPreparePass::runOnOperation() {
32*700637cbSDimitry Andric   llvm::SmallVector<Operation *> opsToTransform;
33*700637cbSDimitry Andric 
34*700637cbSDimitry Andric   for (auto *o : opsToTransform)
35*700637cbSDimitry Andric     runOnOp(o);
36*700637cbSDimitry Andric }
37*700637cbSDimitry Andric 
createLoweringPreparePass()38*700637cbSDimitry Andric std::unique_ptr<Pass> mlir::createLoweringPreparePass() {
39*700637cbSDimitry Andric   return std::make_unique<LoweringPreparePass>();
40*700637cbSDimitry Andric }
41