LLVM 20.0.0git
Classes | Namespaces | Typedefs | Enumerations | Functions
BitcodeReader.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Bitstream/BitCodeEnums.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/MemoryBufferRef.h"
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <system_error>
#include <vector>

Go to the source code of this file.

Classes

struct  llvm::ParserCallbacks
 
struct  llvm::BitcodeLTOInfo
 Basic information extracted from a bitcode module to be used for LTO. More...
 
class  llvm::BitcodeModule
 Represents a module in a bitcode file. More...
 
struct  llvm::BitcodeFileContents
 
struct  std::is_error_code_enum< llvm::BitcodeError >
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  std
 Implement std::hash so that hash_code can be used in STL containers.
 

Typedefs

typedef std::function< std::optional< std::string >(StringRef, StringRef)> llvm::DataLayoutCallbackFuncTy
 
typedef std::function< Type *(unsigned)> llvm::GetTypeByIDTy
 
typedef std::function< unsigned(unsigned, unsigned)> llvm::GetContainedTypeIDTy
 
typedef std::function< void(Value *, unsigned, GetTypeByIDTy, GetContainedTypeIDTy)> llvm::ValueTypeCallbackTy
 
typedef std::function< void(Metadata **, unsigned, GetTypeByIDTy, GetContainedTypeIDTy)> llvm::MDTypeCallbackTy
 

Enumerations

enum class  llvm::BitcodeError { llvm::CorruptedBitcode = 1 }
 

Functions

std::error_code llvm::errorToErrorCodeAndEmitErrors (LLVMContext &Ctx, Error Err)
 
template<typename T >
ErrorOr< Tllvm::expectedToErrorOrAndEmitErrors (LLVMContext &Ctx, Expected< T > Val)
 
Expected< BitcodeFileContentsllvm::getBitcodeFileContents (MemoryBufferRef Buffer)
 Returns the contents of a bitcode file.
 
Expected< std::vector< BitcodeModule > > llvm::getBitcodeModuleList (MemoryBufferRef Buffer)
 Returns a list of modules in the specified bitcode buffer.
 
Expected< std::unique_ptr< Module > > llvm::getLazyBitcodeModule (MemoryBufferRef Buffer, LLVMContext &Context, bool ShouldLazyLoadMetadata=false, bool IsImporting=false, ParserCallbacks Callbacks={})
 Read the header of the specified bitcode buffer and prepare for lazy deserialization of function bodies.
 
Expected< std::unique_ptr< Module > > llvm::getOwningLazyBitcodeModule (std::unique_ptr< MemoryBuffer > &&Buffer, LLVMContext &Context, bool ShouldLazyLoadMetadata=false, bool IsImporting=false, ParserCallbacks Callbacks={})
 Like getLazyBitcodeModule, except that the module takes ownership of the memory buffer if successful.
 
Expected< std::string > llvm::getBitcodeTargetTriple (MemoryBufferRef Buffer)
 Read the header of the specified bitcode buffer and extract just the triple information.
 
Expected< boolllvm::isBitcodeContainingObjCCategory (MemoryBufferRef Buffer)
 Return true if Buffer contains a bitcode file with ObjC code (category or class) in it.
 
Expected< std::string > llvm::getBitcodeProducerString (MemoryBufferRef Buffer)
 Read the header of the specified bitcode buffer and extract just the producer string information.
 
Expected< std::unique_ptr< Module > > llvm::parseBitcodeFile (MemoryBufferRef Buffer, LLVMContext &Context, ParserCallbacks Callbacks={})
 Read the specified bitcode file, returning the module.
 
Expected< BitcodeLTOInfollvm::getBitcodeLTOInfo (MemoryBufferRef Buffer)
 Returns LTO information for the specified bitcode file.
 
Expected< std::unique_ptr< ModuleSummaryIndex > > llvm::getModuleSummaryIndex (MemoryBufferRef Buffer)
 Parse the specified bitcode buffer, returning the module summary index.
 
Error llvm::readModuleSummaryIndex (MemoryBufferRef Buffer, ModuleSummaryIndex &CombinedIndex)
 Parse the specified bitcode buffer and merge the index into CombinedIndex.
 
Expected< std::unique_ptr< ModuleSummaryIndex > > llvm::getModuleSummaryIndexForFile (StringRef Path, bool IgnoreEmptyThinLTOIndexFile=false)
 Parse the module summary index out of an IR file and return the module summary index object if found, or an empty summary if not.
 
bool llvm::isBitcodeWrapper (const unsigned char *BufPtr, const unsigned char *BufEnd)
 isBitcodeWrapper - Return true if the given bytes are the magic bytes for an LLVM IR bitcode wrapper.
 
bool llvm::isRawBitcode (const unsigned char *BufPtr, const unsigned char *BufEnd)
 isRawBitcode - Return true if the given bytes are the magic bytes for raw LLVM IR bitcode (without a wrapper).
 
bool llvm::isBitcode (const unsigned char *BufPtr, const unsigned char *BufEnd)
 isBitcode - Return true if the given bytes are the magic bytes for LLVM IR bitcode, either with or without a wrapper.
 
bool llvm::SkipBitcodeWrapperHeader (const unsigned char *&BufPtr, const unsigned char *&BufEnd, bool VerifyBufferSize)
 SkipBitcodeWrapperHeader - Some systems wrap bc files with a special header for padding or other reasons.
 
APInt llvm::readWideAPInt (ArrayRef< uint64_t > Vals, unsigned TypeBits)
 
const std::error_category & llvm::BitcodeErrorCategory ()
 
std::error_code llvm::make_error_code (BitcodeError E)