clang 24.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
14#include "llvm/ADT/SmallVector.h"
15
16#include "mlir/IR/BuiltinOps.h"
17#include "mlir/IR/OwningOpRef.h"
18
19namespace llvm {
20class LLVMContext;
21} // namespace llvm
22
23namespace mlir {
24class MLIRContext;
25class ModuleOp;
26} // namespace mlir
27
28namespace cir {
29class CIRGenConsumer;
30
32public:
41
42private:
43 friend class CIRGenConsumer;
44
45 mlir::OwningOpRef<mlir::ModuleOp> MLIRMod;
46
47 std::unique_ptr<llvm::LLVMContext> Ctx;
49
50protected:
52
54
55 bool hasCIRSupport() const override { return true; }
56
57 void ExecuteAction() override;
58
59 std::unique_ptr<clang::ASTConsumer>
61 llvm::StringRef InFile) override;
62
63public:
64 ~CIRGenAction() override;
65
67};
68
70 virtual void anchor();
71
72public:
74};
75
77 virtual void anchor();
78
79public:
81};
82
84 virtual void anchor();
85
86public:
88};
89
90class EmitBCAction : public CIRGenAction {
91 virtual void anchor();
92
93public:
95};
96
98 virtual void anchor();
99
100public:
102};
103
105 virtual void anchor();
106
107public:
109};
110
111} // namespace cir
112
113#endif
Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...
bool hasCIRSupport() const override
Does this action support use with CIR files?
OutputType Action
void ExecuteAction() override
Implement the ExecuteAction interface by running Sema on the already-initialized AST consumer.
bool BeginSourceFileAction(clang::CompilerInstance &CI) override
Callback at the start of processing a single input.
~CIRGenAction() override
std::unique_ptr< clang::ASTConsumer > CreateASTConsumer(clang::CompilerInstance &CI, llvm::StringRef InFile) override
CIRGenAction(OutputType Action)
friend class CIRGenConsumer
Abstract base class to use for AST consumer-based frontend actions.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30