clang 20.0.0git
CIRGenAction.h
Go to the documentation of this file.
1//===---- CIRGenAction.h - CIR Code Generation Frontend Action -*- C++ -*--===//
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#ifndef LLVM_CLANG_CIR_CIRGENACTION_H
10#define LLVM_CLANG_CIR_CIRGENACTION_H
11
13
14#include "mlir/IR/BuiltinOps.h"
15#include "mlir/IR/OwningOpRef.h"
16
17namespace mlir {
18class MLIRContext;
19class ModuleOp;
20} // namespace mlir
21
22namespace cir {
23class CIRGenConsumer;
24
26public:
27 enum class OutputType {
28 EmitCIR,
29 };
30
31private:
32 friend class CIRGenConsumer;
33
34 mlir::OwningOpRef<mlir::ModuleOp> MLIRMod;
35
36 mlir::MLIRContext *MLIRCtx;
37
38protected:
39 CIRGenAction(OutputType Action, mlir::MLIRContext *MLIRCtx = nullptr);
40
41 std::unique_ptr<clang::ASTConsumer>
43 llvm::StringRef InFile) override;
44
45public:
46 ~CIRGenAction() override;
47
49};
50
52 virtual void anchor();
53
54public:
55 EmitCIRAction(mlir::MLIRContext *MLIRCtx = nullptr);
56};
57
58} // namespace cir
59
60#endif
Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...
OutputType Action
Definition: CIRGenAction.h:48
~CIRGenAction() override
std::unique_ptr< clang::ASTConsumer > CreateASTConsumer(clang::CompilerInstance &CI, llvm::StringRef InFile) override
Abstract base class to use for AST consumer-based frontend actions.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.