clang 22.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 {
17class BitcodeModule;
18template <typename T> class Expected;
19template <typename T> class IntrusiveRefCntPtr;
20class Module;
21class MemoryBufferRef;
22namespace vfs {
23class FileSystem;
24} / namespace vfs
25} / namespace llvm
26
27namespace clang {
30class CodeGenOptions;
31class BackendConsumer;
32
34 Backend_EmitAssembly, /< Emit native assembly files
35 Backend_EmitBC, /< Emit LLVM bitcode files
36 Backend_EmitLL, /< Emit human-readable LLVM assembly
37 Backend_EmitNothing, /< Don't emit anything (benchmarking mode)
38 Backend_EmitMCNull, /< Run CodeGen, but don't emit anything
39 Backend_EmitObj /< Emit native object files
40};
41
42void emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts,
43 StringRef TDesc, llvm::Module *M, BackendAction Action,
45 std::unique_ptr<raw_pwrite_stream> OS,
46 BackendConsumer *BC = nullptr);
47
48void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
49 llvm::MemoryBufferRef Buf);
50
51void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
52 llvm::vfs::FileSystem &VFS, DiagnosticsEngine &Diags);
53} / namespace clang
54
55#endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:232
The JSON file list parser is used to communicate input to InstallAPI.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
Definition Linkage.h:54
void emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts, StringRef TDesc, llvm::Module *M, BackendAction Action, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::unique_ptr< raw_pwrite_stream > OS, BackendConsumer *BC=nullptr)
void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::vfs::FileSystem &VFS, DiagnosticsEngine &Diags)
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf)
BackendAction
Definition BackendUtil.h:33
@ Backend_EmitAssembly
Emit native assembly files.
Definition BackendUtil.h:34
@ Backend_EmitLL
Emit human-readable LLVM assembly.
Definition BackendUtil.h:36
@ Backend_EmitBC
Emit LLVM bitcode files.
Definition BackendUtil.h:35
@ Backend_EmitObj
Emit native object files.
Definition BackendUtil.h:39
@ Backend_EmitMCNull
Run CodeGen, but don't emit anything.
Definition BackendUtil.h:38
@ Backend_EmitNothing
Don't emit anything (benchmarking mode)
Definition BackendUtil.h:37
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant