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_BACKEND_UTIL_H 11 #define LLVM_CLANG_CODEGEN_BACKEND_UTIL_H 12 13 namespace llvm { 14 class Module; 15 class raw_ostream; 16 } 17 18 namespace clang { 19 class Diagnostic; 20 class CodeGenOptions; 21 class TargetOptions; 22 class LangOptions; 23 24 enum BackendAction { 25 Backend_EmitAssembly, ///< Emit native assembly files 26 Backend_EmitBC, ///< Emit LLVM bitcode files 27 Backend_EmitLL, ///< Emit human-readable LLVM assembly 28 Backend_EmitNothing, ///< Don't emit anything (benchmarking mode) 29 Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything 30 Backend_EmitObj ///< Emit native object files 31 }; 32 33 void EmitBackendOutput(Diagnostic &Diags, const CodeGenOptions &CGOpts, 34 const TargetOptions &TOpts, const LangOptions &LOpts, 35 llvm::Module *M, 36 BackendAction Action, llvm::raw_ostream *OS); 37 } 38 39 #endif 40