clang 17.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
35 Backend_EmitAssembly, ///< Emit native assembly files
36 Backend_EmitBC, ///< Emit LLVM bitcode files
37 Backend_EmitLL, ///< Emit human-readable LLVM assembly
38 Backend_EmitNothing, ///< Don't emit anything (benchmarking mode)
39 Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything
40 Backend_EmitObj ///< Emit native object files
41 };
42
44 const CodeGenOptions &CGOpts,
45 const TargetOptions &TOpts, const LangOptions &LOpts,
46 StringRef TDesc, llvm::Module *M, BackendAction Action,
48 std::unique_ptr<raw_pwrite_stream> OS);
49
50 void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
51 llvm::MemoryBufferRef Buf);
52
53 void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
54 DiagnosticsEngine &Diags);
55}
56
57#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...
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:192
HeaderSearchOptions - Helper class for storing options related to the initialization of the HeaderSea...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:82
Options for controlling the target.
Definition: TargetOptions.h:26
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)
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf)
BackendAction
Definition: BackendUtil.h:34
@ Backend_EmitAssembly
Emit native assembly files.
Definition: BackendUtil.h:35
@ Backend_EmitLL
Emit human-readable LLVM assembly.
Definition: BackendUtil.h:37
@ Backend_EmitBC
Emit LLVM bitcode files.
Definition: BackendUtil.h:36
@ Backend_EmitObj
Emit native object files.
Definition: BackendUtil.h:40
@ Backend_EmitMCNull
Run CodeGen, but don't emit anything.
Definition: BackendUtil.h:39
@ Backend_EmitNothing
Don't emit anything (benchmarking mode)
Definition: BackendUtil.h:38
YAML serialization mapping.
Definition: Dominators.h:30