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;
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
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);
43 void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
44 llvm::MemoryBufferRef Buf);