LLVM API Documentation
#include <BitcodeReader.h>
Public Member Functions | |
std::error_code | Error (BitcodeError E) |
BitcodeReader (MemoryBuffer *buffer, LLVMContext &C) | |
BitcodeReader (DataStreamer *streamer, LLVMContext &C) | |
~BitcodeReader () | |
std::error_code | materializeForwardReferencedFunctions () |
void | FreeState () |
void | releaseBuffer () |
bool | isMaterializable (const GlobalValue *GV) const override |
bool | isDematerializable (const GlobalValue *GV) const override |
std::error_code | Materialize (GlobalValue *GV) override |
std::error_code | MaterializeModule (Module *M) override |
void | Dematerialize (GlobalValue *GV) override |
std::error_code | ParseBitcodeInto (Module *M) |
Main interface to parsing a bitcode buffer. | |
ErrorOr< std::string > | parseTriple () |
Cheap mechanism to just extract module triple. | |
Static Public Member Functions | |
static uint64_t | decodeSignRotatedValue (uint64_t V) |
Definition at line 127 of file BitcodeReader.h.
llvm::BitcodeReader::BitcodeReader | ( | MemoryBuffer * | buffer, |
LLVMContext & | C | ||
) | [inline, explicit] |
Definition at line 208 of file BitcodeReader.h.
llvm::BitcodeReader::BitcodeReader | ( | DataStreamer * | streamer, |
LLVMContext & | C | ||
) | [inline, explicit] |
Definition at line 213 of file BitcodeReader.h.
llvm::BitcodeReader::~BitcodeReader | ( | ) | [inline] |
Definition at line 218 of file BitcodeReader.h.
References FreeState().
uint64_t BitcodeReader::decodeSignRotatedValue | ( | uint64_t | V | ) | [static] |
decodeSignRotatedValue - Decode a signed value stored with the sign bit in the LSB for dense VBR encoding.
Definition at line 1137 of file BitcodeReader.cpp.
Referenced by ReadWideAPInt().
void BitcodeReader::Dematerialize | ( | GlobalValue * | ) | [override, virtual] |
If the given GlobalValue is read in, and if the GVMaterializer supports it, release the memory for the GV, and set it up to be materialized lazily. If the Materializer doesn't support this capability, this method is a noop.
Reimplemented from llvm::GVMaterializer.
Definition at line 3339 of file BitcodeReader.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), llvm::Function::deleteBody(), llvm::dyn_cast(), and isDematerializable().
std::error_code llvm::BitcodeReader::Error | ( | BitcodeError | E | ) | [inline] |
Definition at line 206 of file BitcodeReader.h.
References llvm::make_error_code().
Referenced by materializeForwardReferencedFunctions(), MaterializeModule(), ParseBitcodeInto(), and parseTriple().
void BitcodeReader::FreeState | ( | ) |
Definition at line 67 of file BitcodeReader.cpp.
References llvm::BitcodeReaderValueList::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), llvm::BitcodeReaderMDValueList::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty(), and std::swap().
Referenced by ~BitcodeReader().
bool BitcodeReader::isDematerializable | ( | const GlobalValue * | GV | ) | const [override, virtual] |
True if GV has been materialized and can be dematerialized back to whatever backing store this GVMaterializer uses.
Implements llvm::GVMaterializer.
Definition at line 3326 of file BitcodeReader.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dyn_cast(), and llvm::GlobalValue::isDeclaration().
Referenced by Dematerialize().
bool BitcodeReader::isMaterializable | ( | const GlobalValue * | GV | ) | const [override, virtual] |
True if GV can be materialized from whatever backing store this GVMaterializer uses and has not been materialized yet.
Implements llvm::GVMaterializer.
Definition at line 3281 of file BitcodeReader.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), and llvm::GlobalValue::isDeclaration().
std::error_code BitcodeReader::Materialize | ( | GlobalValue * | GV | ) | [override, virtual] |
Make sure the given GlobalValue is fully read.
Implements llvm::GVMaterializer.
Definition at line 3289 of file BitcodeReader.cpp.
References llvm::dyn_cast(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), I, llvm::GlobalValue::isMaterializable(), llvm::BitstreamCursor::JumpToBit(), materializeForwardReferencedFunctions(), and llvm::UpgradeIntrinsicCall().
Referenced by materializeForwardReferencedFunctions(), and MaterializeModule().
std::error_code BitcodeReader::materializeForwardReferencedFunctions | ( | ) |
Definition at line 34 of file BitcodeReader.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty(), Error(), F(), llvm::GlobalValue::isMaterializable(), Materialize(), and llvm::NeverResolvedFunctionFromBlockAddress.
Referenced by Materialize().
std::error_code BitcodeReader::MaterializeModule | ( | Module * | M | ) | [override, virtual] |
Make sure the entire Module has been completely read.
Implements llvm::GVMaterializer.
Definition at line 3351 of file BitcodeReader.cpp.
References llvm::Module::begin(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty(), llvm::Module::end(), Error(), F(), I, llvm::GlobalValue::isMaterializable(), Materialize(), llvm::NeverResolvedFunctionFromBlockAddress, llvm::SmallVectorTemplateCommon< T, typename >::size(), std::swap(), llvm::UpgradeDebugInfo(), llvm::UpgradeInstWithTBAATag(), and llvm::UpgradeIntrinsicCall().
std::error_code BitcodeReader::ParseBitcodeInto | ( | Module * | M | ) |
Main interface to parsing a bitcode buffer.
Definition at line 2120 of file BitcodeReader.cpp.
References llvm::BitstreamCursor::advance(), llvm::BitstreamCursor::AF_DontAutoprocessAbbrevs, llvm::BitstreamCursor::AtEndOfStream(), llvm::bitc::BLOCKINFO_BLOCK_ID, llvm::BitstreamEntry::EndBlock, llvm::BitstreamEntry::Error, Error(), llvm::BitstreamCursor::getAbbrevIDWidth(), llvm::BitstreamEntry::ID, llvm::InvalidBitcodeSignature, llvm::InvalidMultipleBlocks, llvm::InvalidRecord, llvm::BitstreamEntry::Kind, llvm::MalformedBlock, llvm::bitc::MODULE_BLOCK_ID, llvm::BitstreamCursor::Read(), llvm::BitstreamCursor::ReadBlockInfoBlock(), llvm::BitstreamEntry::Record, llvm::BitstreamCursor::SkipBlock(), and llvm::BitstreamEntry::SubBlock.
Referenced by llvm::getStreamedBitcodeModule().
ErrorOr< std::string > BitcodeReader::parseTriple | ( | ) |
Cheap mechanism to just extract module triple.
Definition at line 2226 of file BitcodeReader.cpp.
References llvm::BitstreamCursor::advance(), llvm::BitstreamEntry::EndBlock, llvm::BitstreamEntry::Error, Error(), llvm::BitstreamEntry::ID, llvm::InvalidBitcodeSignature, llvm::BitstreamEntry::Kind, llvm::MalformedBlock, llvm::bitc::MODULE_BLOCK_ID, llvm::BitstreamCursor::Read(), llvm::BitstreamEntry::Record, llvm::BitstreamCursor::SkipBlock(), llvm::BitstreamCursor::skipRecord(), and llvm::BitstreamEntry::SubBlock.
void BitcodeReader::releaseBuffer | ( | ) |
Definition at line 3279 of file BitcodeReader.cpp.