clang  3.9.0
BackendUtil.h
Go to the documentation of this file.
1 //===--- BackendUtil.h - LLVM Backend Utilities -----------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_CODEGEN_BACKENDUTIL_H
11 #define LLVM_CLANG_CODEGEN_BACKENDUTIL_H
12 
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/IR/ModuleSummaryIndex.h"
15 #include <memory>
16 
17 namespace llvm {
18  class Module;
19  class MemoryBufferRef;
20 }
21 
22 namespace clang {
23  class DiagnosticsEngine;
24  class CodeGenOptions;
25  class TargetOptions;
26  class LangOptions;
27 
29  Backend_EmitAssembly, ///< Emit native assembly files
30  Backend_EmitBC, ///< Emit LLVM bitcode files
31  Backend_EmitLL, ///< Emit human-readable LLVM assembly
32  Backend_EmitNothing, ///< Don't emit anything (benchmarking mode)
33  Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything
34  Backend_EmitObj ///< Emit native object files
35  };
36 
37  void EmitBackendOutput(DiagnosticsEngine &Diags, const CodeGenOptions &CGOpts,
38  const TargetOptions &TOpts, const LangOptions &LOpts,
39  const llvm::DataLayout &TDesc, llvm::Module *M,
41  std::unique_ptr<raw_pwrite_stream> OS);
42 
43  void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
44  llvm::MemoryBufferRef Buf);
45 }
46 
47 #endif
Emit human-readable LLVM assembly.
Definition: BackendUtil.h:31
Run CodeGen, but don't emit anything.
Definition: BackendUtil.h:33
Don't emit anything (benchmarking mode)
Definition: BackendUtil.h:32
Emit LLVM bitcode files.
Definition: BackendUtil.h:30
FrontendAction * Action
Definition: Tooling.cpp:201
BackendAction
Definition: BackendUtil.h:28
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Emit native object files.
Definition: BackendUtil.h:34
Emit native assembly files.
Definition: BackendUtil.h:29
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf)
void EmitBackendOutput(DiagnosticsEngine &Diags, const CodeGenOptions &CGOpts, const TargetOptions &TOpts, const LangOptions &LOpts, const llvm::DataLayout &TDesc, llvm::Module *M, BackendAction Action, std::unique_ptr< raw_pwrite_stream > OS)