1 | |
2 | |
3 | |
4 | |
5 | |
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 ; |
26 | class CodeGenOptions; |
27 | class TargetOptions; |
28 | class LangOptions; |
29 | |
30 | enum BackendAction { |
31 | Backend_EmitAssembly, |
32 | Backend_EmitBC, |
33 | Backend_EmitLL, |
34 | Backend_EmitNothing, |
35 | Backend_EmitMCNull, |
36 | Backend_EmitObj |
37 | }; |
38 | |
39 | void (DiagnosticsEngine &Diags, const HeaderSearchOptions &, |
40 | const CodeGenOptions &CGOpts, |
41 | const TargetOptions &TOpts, const LangOptions &LOpts, |
42 | const llvm::DataLayout &TDesc, llvm::Module *M, |
43 | BackendAction Action, |
44 | std::unique_ptr<raw_pwrite_stream> OS); |
45 | |
46 | void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, |
47 | llvm::MemoryBufferRef Buf); |
48 | |
49 | llvm::Expected<llvm::BitcodeModule> |
50 | FindThinLTOModule(llvm::MemoryBufferRef MBRef); |
51 | llvm::BitcodeModule * |
52 | FindThinLTOModule(llvm::MutableArrayRef<llvm::BitcodeModule> BMs); |
53 | } |
54 | |
55 | #endif |
56 | |