clang API Documentation
00001 //===--- BackendUtil.h - LLVM Backend Utilities -----------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_CLANG_CODEGEN_BACKENDUTIL_H 00011 #define LLVM_CLANG_CODEGEN_BACKENDUTIL_H 00012 00013 #include "clang/Basic/LLVM.h" 00014 00015 namespace llvm { 00016 class Module; 00017 } 00018 00019 namespace clang { 00020 class DiagnosticsEngine; 00021 class CodeGenOptions; 00022 class TargetOptions; 00023 class LangOptions; 00024 00025 enum BackendAction { 00026 Backend_EmitAssembly, ///< Emit native assembly files 00027 Backend_EmitBC, ///< Emit LLVM bitcode files 00028 Backend_EmitLL, ///< Emit human-readable LLVM assembly 00029 Backend_EmitNothing, ///< Don't emit anything (benchmarking mode) 00030 Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything 00031 Backend_EmitObj ///< Emit native object files 00032 }; 00033 00034 void EmitBackendOutput(DiagnosticsEngine &Diags, const CodeGenOptions &CGOpts, 00035 const TargetOptions &TOpts, const LangOptions &LOpts, 00036 StringRef TDesc, llvm::Module *M, BackendAction Action, 00037 raw_ostream *OS); 00038 } 00039 00040 #endif