clang 24.0.0git
LowerToLLVM.h
Go to the documentation of this file.
1//====- LowerToLLVM.h- Lowering from CIR to LLVM --------------------------===//
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// This file declares an interface for converting CIR modules to LLVM IR.
10//
11//===----------------------------------------------------------------------===//
12#ifndef CLANG_CIR_LOWERTOLLVM_H
13#define CLANG_CIR_LOWERTOLLVM_H
14
15#include "llvm/ADT/StringRef.h"
16#include "llvm/Support/VirtualFileSystemFwd.h"
17#include <memory>
18
19namespace llvm {
20class LLVMContext;
21class Module;
22} // namespace llvm
23
24namespace mlir {
25class ModuleOp;
26} // namespace mlir
27
28namespace cir {
29
30namespace direct {
31/// Lowers \p mlirModule, a CIR module, to an LLVM module in \p llvmCtx.
32/// Returns null if lowering fails; the error has then been reported through
33/// the MLIR diagnostic engine of \p mlirModule's context.
34std::unique_ptr<llvm::Module>
35lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp mlirModule,
36 llvm::LLVMContext &llvmCtx, bool enableOpenMP,
37 llvm::StringRef mlirSaveTempsOutFile = {},
38 llvm::vfs::FileSystem *fs = nullptr);
39} // namespace direct
40} // namespace cir
41
42#endif // CLANG_CIR_LOWERTOLLVM_H
std::unique_ptr< llvm::Module > lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp mlirModule, llvm::LLVMContext &llvmCtx, bool enableOpenMP, llvm::StringRef mlirSaveTempsOutFile={}, llvm::vfs::FileSystem *fs=nullptr)
Lowers mlirModule, a CIR module, to an LLVM module in llvmCtx.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
Definition Linkage.h:54
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30