1 //===--- BackendUtil.h - LLVM Backend Utilities -----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_CODEGEN_BACKENDUTIL_H
11 #define LLVM_CLANG_CODEGEN_BACKENDUTIL_H
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/IR/ModuleSummaryIndex.h"
19 class MemoryBufferRef;
23 class DiagnosticsEngine;
24 class HeaderSearchOptions;
30 Backend_EmitAssembly, ///< Emit native assembly files
31 Backend_EmitBC, ///< Emit LLVM bitcode files
32 Backend_EmitLL, ///< Emit human-readable LLVM assembly
33 Backend_EmitNothing, ///< Don't emit anything (benchmarking mode)
34 Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything
35 Backend_EmitObj ///< Emit native object files
38 void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &,
39 const CodeGenOptions &CGOpts,
40 const TargetOptions &TOpts, const LangOptions &LOpts,
41 const llvm::DataLayout &TDesc, llvm::Module *M,
43 std::unique_ptr<raw_pwrite_stream> OS);
45 void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
46 llvm::MemoryBufferRef Buf);