LLVM 20.0.0git
Public Member Functions | Friends | List of all members
llvm::BitcodeModule Class Reference

Represents a module in a bitcode file. More...

#include "llvm/Bitcode/BitcodeReader.h"

Public Member Functions

StringRef getBuffer () const
 
StringRef getStrtab () const
 
StringRef getModuleIdentifier () const
 
Expected< std::unique_ptr< Module > > getLazyModule (LLVMContext &Context, bool ShouldLazyLoadMetadata, bool IsImporting, ParserCallbacks Callbacks={})
 Read the bitcode module and prepare for lazy deserialization of function bodies.
 
Expected< std::unique_ptr< Module > > parseModule (LLVMContext &Context, ParserCallbacks Callbacks={})
 Read the entire bitcode module and return it.
 
Expected< BitcodeLTOInfogetLTOInfo ()
 Returns information about the module to be used for LTO: whether to compile with ThinLTO, and whether it has a summary.
 
Expected< std::unique_ptr< ModuleSummaryIndex > > getSummary ()
 Parse the specified bitcode buffer, returning the module summary index.
 
Error readSummary (ModuleSummaryIndex &CombinedIndex, StringRef ModulePath, std::function< bool(GlobalValue::GUID)> IsPrevailing=nullptr)
 Parse the specified bitcode buffer and merge its module summary index into CombinedIndex.
 

Friends

Expected< BitcodeFileContentsgetBitcodeFileContents (MemoryBufferRef Buffer)
 Returns the contents of a bitcode file.
 

Detailed Description

Represents a module in a bitcode file.

Definition at line 101 of file BitcodeReader.h.

Member Function Documentation

◆ getBuffer()

StringRef llvm::BitcodeModule::getBuffer ( ) const
inline

Definition at line 130 of file BitcodeReader.h.

References llvm::ArrayRef< T >::begin(), and llvm::ArrayRef< T >::size().

◆ getLazyModule()

Expected< std::unique_ptr< Module > > BitcodeModule::getLazyModule ( LLVMContext Context,
bool  ShouldLazyLoadMetadata,
bool  IsImporting,
ParserCallbacks  Callbacks = {} 
)

Read the bitcode module and prepare for lazy deserialization of function bodies.

If ShouldLazyLoadMetadata is true, lazily load metadata as well. If IsImporting is true, this module is being parsed for ThinLTO importing into another module.

Definition at line 8384 of file BitcodeReader.cpp.

◆ getLTOInfo()

Expected< BitcodeLTOInfo > BitcodeModule::getLTOInfo ( )

◆ getModuleIdentifier()

StringRef llvm::BitcodeModule::getModuleIdentifier ( ) const
inline

Definition at line 136 of file BitcodeReader.h.

◆ getStrtab()

StringRef llvm::BitcodeModule::getStrtab ( ) const
inline

Definition at line 134 of file BitcodeReader.h.

◆ getSummary()

Expected< std::unique_ptr< ModuleSummaryIndex > > BitcodeModule::getSummary ( )

Parse the specified bitcode buffer, returning the module summary index.

Definition at line 8407 of file BitcodeReader.cpp.

References llvm::BitstreamCursor::JumpToBit().

◆ parseModule()

Expected< std::unique_ptr< Module > > BitcodeModule::parseModule ( LLVMContext Context,
ParserCallbacks  Callbacks = {} 
)

Read the entire bitcode module and return it.

Definition at line 8567 of file BitcodeReader.cpp.

◆ readSummary()

Error BitcodeModule::readSummary ( ModuleSummaryIndex CombinedIndex,
StringRef  ModulePath,
std::function< bool(GlobalValue::GUID)>  IsPrevailing = nullptr 
)

Parse the specified bitcode buffer and merge its module summary index into CombinedIndex.

Definition at line 8394 of file BitcodeReader.cpp.

References llvm::BitstreamCursor::JumpToBit().

Friends And Related Function Documentation

◆ getBitcodeFileContents

Expected< BitcodeFileContents > getBitcodeFileContents ( MemoryBufferRef  Buffer)
friend

Returns the contents of a bitcode file.

This includes the raw contents of the symbol table embedded in the bitcode file. Clients which require a symbol table should prefer to use irsymtab::read instead of this function because it creates a reader for the irsymtab and handles upgrading bitcode files without a symbol table or with an old symbol table.


The documentation for this class was generated from the following files: