Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:51

0001 //===--- BackendUtil.h - LLVM Backend Utilities -----------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_CODEGEN_BACKENDUTIL_H
0010 #define LLVM_CLANG_CODEGEN_BACKENDUTIL_H
0011 
0012 #include "clang/Basic/LLVM.h"
0013 #include "llvm/IR/ModuleSummaryIndex.h"
0014 #include <memory>
0015 
0016 namespace llvm {
0017 class BitcodeModule;
0018 template <typename T> class Expected;
0019 template <typename T> class IntrusiveRefCntPtr;
0020 class Module;
0021 class MemoryBufferRef;
0022 namespace vfs {
0023 class FileSystem;
0024 } // namespace vfs
0025 } // namespace llvm
0026 
0027 namespace clang {
0028 class CompilerInstance;
0029 class DiagnosticsEngine;
0030 class CodeGenOptions;
0031 class BackendConsumer;
0032 
0033 enum BackendAction {
0034   Backend_EmitAssembly, ///< Emit native assembly files
0035   Backend_EmitBC,       ///< Emit LLVM bitcode files
0036   Backend_EmitLL,       ///< Emit human-readable LLVM assembly
0037   Backend_EmitNothing,  ///< Don't emit anything (benchmarking mode)
0038   Backend_EmitMCNull,   ///< Run CodeGen, but don't emit anything
0039   Backend_EmitObj       ///< Emit native object files
0040 };
0041 
0042 void emitBackendOutput(CompilerInstance &CI, CodeGenOptions &CGOpts,
0043                        StringRef TDesc, llvm::Module *M, BackendAction Action,
0044                        llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
0045                        std::unique_ptr<raw_pwrite_stream> OS,
0046                        BackendConsumer *BC = nullptr);
0047 
0048 void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
0049                   llvm::MemoryBufferRef Buf);
0050 
0051 void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
0052                  DiagnosticsEngine &Diags);
0053 } // namespace clang
0054 
0055 #endif