9#ifndef FORTRAN_OPTIMIZER_CODEGEN_CODEGEN_H
10#define FORTRAN_OPTIMIZER_CODEGEN_CODEGEN_H
12#include "flang/Frontend/CodeGenOptions.h"
13#include "mlir/IR/BuiltinOps.h"
14#include "mlir/Pass/Pass.h"
15#include "mlir/Pass/PassRegistry.h"
16#include "llvm/IR/Module.h"
17#include "llvm/Support/raw_ostream.h"
22class LLVMTypeConverter;
26#define GEN_PASS_DECL_FIRTOLLVMLOWERING
27#define GEN_PASS_DECL_CODEGENREWRITE
28#define GEN_PASS_DECL_TARGETREWRITEPASS
29#define GEN_PASS_DECL_BOXEDPROCEDUREPASS
30#define GEN_PASS_DECL_LOWERREPACKARRAYSPASS
31#include "flang/Optimizer/CodeGen/CGPasses.h.inc"
42 bool ignoreMissingTypeDescriptors =
false;
45 bool skipExternalRttiDefinition =
false;
48 bool applyTBAA =
false;
51 bool forceUnifiedTBAATree =
false;
61 bool typeDescriptorsRenamedForAssembly =
false;
75using LLVMIRLoweringPrinter =
76 std::function<void(llvm::Module &, llvm::raw_ostream &)>;
80 llvm::raw_ostream &output,
81 LLVMIRLoweringPrinter printer =
82 [](llvm::Module &m, llvm::raw_ostream &out) { m.print(out,
nullptr); });
91 bool preserveDeclare);
94#define GEN_PASS_REGISTRATION
95#include "flang/Optimizer/CodeGen/CGPasses.h.inc"
ComplexRangeKind
Controls the various implementations for complex division.
Definition: CodeGenOptions.h:196
@ CX_Full
Definition: CodeGenOptions.h:200
Definition: TypeConverter.h:50
Definition: AbstractConverter.h:34
std::unique_ptr< mlir::Pass > createFIRToLLVMPass()
Convert FIR to the LLVM IR dialect with default options.
Definition: CodeGen.cpp:4297
void populatePreCGRewritePatterns(mlir::RewritePatternSet &patterns, bool preserveDeclare)
Populate the pattern set with the PreCGRewrite patterns.
Definition: PreCGRewrite.cpp:387
std::unique_ptr< mlir::Pass > createLLVMDialectToLLVMPass(llvm::raw_ostream &output, LLVMIRLoweringPrinter printer=[](llvm::Module &m, llvm::raw_ostream &out) { m.print(out, nullptr);})
Convert the LLVM IR dialect to LLVM-IR proper.
Definition: CodeGen.cpp:4307
void populateFIRToLLVMConversionPatterns(const fir::LLVMTypeConverter &converter, mlir::RewritePatternSet &patterns, fir::FIRToLLVMPassOptions &options)
Populate the given list with patterns that convert from FIR to LLVM.
Definition: CodeGen.cpp:4312
FIR to LLVM translation pass options.
Definition: CodeGen.h:34