clang 20.0.0git
BackendUtil.h
Go to the documentation of this file.
1//===--- BackendUtil.h - LLVM Backend Utilities -----------------*- 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_CODEGEN_BACKENDUTIL_H
10#define LLVM_CLANG_CODEGEN_BACKENDUTIL_H
11
12#include "clang/Basic/LLVM.h"
13#include "llvm/IR/ModuleSummaryIndex.h"
14#include <memory>
15
16namespace llvm {
17 class BitcodeModule;
18 template <typename T> class Expected;
19 template <typename T> class IntrusiveRefCntPtr;
20 class Module;
21 class MemoryBufferRef;
22 namespace vfs {
23 class FileSystem;
24 } // namespace vfs
25}
26
27namespace clang {
28 class DiagnosticsEngine;
29 class HeaderSearchOptions;
30 class CodeGenOptions;
31 class TargetOptions;
32 class LangOptions;
33 class BackendConsumer;
34
36 Backend_EmitAssembly, ///< Emit native assembly files
37 Backend_EmitBC, ///< Emit LLVM bitcode files
38 Backend_EmitLL, ///< Emit human-readable LLVM assembly
39 Backend_EmitNothing, ///< Don't emit anything (benchmarking mode)
40 Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything
41 Backend_EmitObj ///< Emit native object files
42 };
43
44 void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &,
45 const CodeGenOptions &CGOpts,
46 const TargetOptions &TOpts, const LangOptions &LOpts,
47 StringRef TDesc, llvm::Module *M, BackendAction Action,
49 std::unique_ptr<raw_pwrite_stream> OS,
50 BackendConsumer *BC = nullptr);
51
52 void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
53 llvm::MemoryBufferRef Buf);
54
55 void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
56 DiagnosticsEngine &Diags);
57}
58
59#endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
The JSON file list parser is used to communicate input to InstallAPI.
void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts, DiagnosticsEngine &Diags)
void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &, const CodeGenOptions &CGOpts, const TargetOptions &TOpts, const LangOptions &LOpts, StringRef TDesc, llvm::Module *M, BackendAction Action, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::unique_ptr< raw_pwrite_stream > OS, BackendConsumer *BC=nullptr)
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf)
BackendAction
Definition: BackendUtil.h:35
@ Backend_EmitAssembly
Emit native assembly files.
Definition: BackendUtil.h:36
@ Backend_EmitLL
Emit human-readable LLVM assembly.
Definition: BackendUtil.h:38
@ Backend_EmitBC
Emit LLVM bitcode files.
Definition: BackendUtil.h:37
@ Backend_EmitObj
Emit native object files.
Definition: BackendUtil.h:41
@ Backend_EmitMCNull
Run CodeGen, but don't emit anything.
Definition: BackendUtil.h:40
@ Backend_EmitNothing
Don't emit anything (benchmarking mode)
Definition: BackendUtil.h:39
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30