clang  16.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 
16 namespace llvm {
17  class BitcodeModule;
18  template <typename T> class Expected;
19  class Module;
20  class MemoryBufferRef;
21 }
22 
23 namespace clang {
24  class DiagnosticsEngine;
25  class HeaderSearchOptions;
26  class CodeGenOptions;
27  class TargetOptions;
28  class LangOptions;
29 
31  Backend_EmitAssembly, ///< Emit native assembly files
32  Backend_EmitBC, ///< Emit LLVM bitcode files
33  Backend_EmitLL, ///< Emit human-readable LLVM assembly
34  Backend_EmitNothing, ///< Don't emit anything (benchmarking mode)
35  Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything
36  Backend_EmitObj ///< Emit native object files
37  };
38 
39  void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &,
40  const CodeGenOptions &CGOpts,
41  const TargetOptions &TOpts, const LangOptions &LOpts,
42  StringRef TDesc, llvm::Module *M, BackendAction Action,
43  std::unique_ptr<raw_pwrite_stream> OS);
44 
45  void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
46  llvm::MemoryBufferRef Buf);
47 
48  void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
49  DiagnosticsEngine &Diags);
50 }
51 
52 #endif
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::Backend_EmitLL
@ Backend_EmitLL
Emit human-readable LLVM assembly.
Definition: BackendUtil.h:33
llvm::Expected
Definition: LLVM.h:41
clang::BackendAction
BackendAction
Definition: BackendUtil.h:30
clang::index::SymbolKind::Module
@ Module
clang::Backend_EmitBC
@ Backend_EmitBC
Emit LLVM bitcode files.
Definition: BackendUtil.h:32
clang::Backend_EmitMCNull
@ Backend_EmitMCNull
Run CodeGen, but don't emit anything.
Definition: BackendUtil.h:35
clang::EmbedBitcode
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf)
Definition: BackendUtil.cpp:1290
clang::EmbedObject
void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts, DiagnosticsEngine &Diags)
Definition: BackendUtil.cpp:1300
LLVM.h
clang::EmitBackendOutput
void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &, const CodeGenOptions &CGOpts, const TargetOptions &TOpts, const LangOptions &LOpts, StringRef TDesc, llvm::Module *M, BackendAction Action, std::unique_ptr< raw_pwrite_stream > OS)
clang::Backend_EmitAssembly
@ Backend_EmitAssembly
Emit native assembly files.
Definition: BackendUtil.h:31
clang
Definition: CalledOnceCheck.h:17
clang::Backend_EmitNothing
@ Backend_EmitNothing
Don't emit anything (benchmarking mode)
Definition: BackendUtil.h:34
clang::Backend_EmitObj
@ Backend_EmitObj
Emit native object files.
Definition: BackendUtil.h:36