LLVM API Documentation

llvm::BitcodeReader Class Reference

#include <BitcodeReader.h>

Inheritance diagram for llvm::BitcodeReader:
[legend]
Collaboration diagram for llvm::BitcodeReader:
[legend]

List of all members.

Public Member Functions

 BitcodeReader (MemoryBuffer *buffer, LLVMContext &C)
 ~BitcodeReader ()
void FreeState ()
void releaseMemoryBuffer ()
virtual bool materializeFunction (Function *F, std::string *ErrInfo=0)
virtual Module * materializeModule (std::string *ErrInfo=0)
virtual void dematerializeFunction (Function *F)
virtual Module * releaseModule (std::string *ErrInfo=0)
 Release our hold on the generated module.
bool Error (const char *Str)
const char * getErrorString () const
bool ParseBitcode ()
 Main interface to parsing a bitcode buffer.


Detailed Description

Definition at line 124 of file BitcodeReader.h.


Constructor & Destructor Documentation

llvm::BitcodeReader::BitcodeReader ( MemoryBuffer *  buffer,
LLVMContext &  C 
) [inline, explicit]

Definition at line 165 of file BitcodeReader.h.

llvm::BitcodeReader::~BitcodeReader (  )  [inline]

Definition at line 169 of file BitcodeReader.h.

References FreeState().


Member Function Documentation

void BitcodeReader::FreeState (  ) 

void llvm::BitcodeReader::releaseMemoryBuffer (  )  [inline]

releaseMemoryBuffer - This causes the reader to completely forget about the memory buffer it contains, which prevents the buffer from being destroyed when it is deleted.

Definition at line 178 of file BitcodeReader.h.

Referenced by llvm::getBitcodeModuleProvider(), and llvm::ParseBitcodeFile().

bool BitcodeReader::materializeFunction ( Function *  F,
std::string *  ErrInfo = 0 
) [virtual]

materializeFunction - make sure the given function is fully read. If the module is corrupt, this returns true and fills in the optional string with information about the problem. If successful, this returns false.

Implements llvm::ModuleProvider.

Definition at line 2122 of file BitcodeReader.cpp.

References E, llvm::GlobalValue::hasNotBeenReadFromBitcode(), llvm::BitstreamCursor::JumpToBit(), llvm::GlobalValue::setLinkage(), llvm::UpgradeIntrinsicCall(), llvm::Value::use_begin(), and llvm::Value::use_end().

Referenced by materializeModule().

Module * BitcodeReader::materializeModule ( std::string *  ErrInfo = 0  )  [virtual]

void BitcodeReader::dematerializeFunction ( Function *   )  [virtual]

dematerializeFunction - If the given function is read in, and if the module provider supports it, release the memory for the function, and set it up to be materialized lazily. If the provider doesn't support this capability, this method is a noop.

Reimplemented from llvm::ModuleProvider.

Definition at line 2155 of file BitcodeReader.cpp.

References llvm::Function::deleteBody(), llvm::GlobalValue::GhostLinkage, llvm::GlobalValue::hasNotBeenReadFromBitcode(), llvm::Function::isDeclaration(), and llvm::GlobalValue::setLinkage().

Module * BitcodeReader::releaseModule ( std::string *  ErrInfo = 0  )  [virtual]

Release our hold on the generated module.

This method is provided by the parent ModuleProvde class and overriden here. It simply releases the module from its provided and frees up our state.

Reimplemented from llvm::ModuleProvider.

Definition at line 2204 of file BitcodeReader.cpp.

References FreeState(), M, and llvm::ModuleProvider::releaseModule().

Referenced by llvm::ParseBitcodeFile().

bool llvm::BitcodeReader::Error ( const char *  Str  )  [inline]

Definition at line 187 of file BitcodeReader.h.

Referenced by ParseBitcode().

const char* llvm::BitcodeReader::getErrorString (  )  const [inline]

Definition at line 191 of file BitcodeReader.h.

Referenced by llvm::getBitcodeModuleProvider().

bool BitcodeReader::ParseBitcode (  ) 


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