LLVM  6.0.0svn
Public Member Functions | List of all members
llvm::BitcodeReaderValueList Class Reference

#include "Bitcode/Reader/ValueList.h"

Public Member Functions

 BitcodeReaderValueList (LLVMContext &C)
 
 ~BitcodeReaderValueList ()
 
unsigned size () const
 
void resize (unsigned N)
 
void push_back (Value *V)
 
void clear ()
 
Valueoperator[] (unsigned i) const
 
Valueback () const
 
void pop_back ()
 
bool empty () const
 
void shrinkTo (unsigned N)
 
ConstantgetConstantFwdRef (unsigned Idx, Type *Ty)
 
ValuegetValueFwdRef (unsigned Idx, Type *Ty)
 
void assignValue (Value *V, unsigned Idx)
 
void resolveConstantForwardRefs ()
 Once all constants are read, this method bulk resolves any forward references. More...
 

Detailed Description

Definition at line 29 of file ValueList.h.

Constructor & Destructor Documentation

◆ BitcodeReaderValueList()

llvm::BitcodeReaderValueList::BitcodeReaderValueList ( LLVMContext C)
inline

Definition at line 44 of file ValueList.h.

◆ ~BitcodeReaderValueList()

llvm::BitcodeReaderValueList::~BitcodeReaderValueList ( )
inline

Definition at line 46 of file ValueList.h.

References assert().

Member Function Documentation

◆ assignValue()

void BitcodeReaderValueList::assignValue ( Value V,
unsigned  Idx 
)

Definition at line 69 of file ValueList.cpp.

References llvm::Value::deleteValue().

Referenced by shrinkTo().

◆ back()

Value* llvm::BitcodeReaderValueList::back ( ) const
inline

Definition at line 65 of file ValueList.h.

◆ clear()

void llvm::BitcodeReaderValueList::clear ( )
inline

Definition at line 55 of file ValueList.h.

References assert().

◆ empty()

bool llvm::BitcodeReaderValueList::empty ( ) const
inline

Definition at line 67 of file ValueList.h.

◆ getConstantFwdRef()

Constant * BitcodeReaderValueList::getConstantFwdRef ( unsigned  Idx,
Type Ty 
)

Definition at line 97 of file ValueList.cpp.

References C, Context, and llvm::report_fatal_error().

Referenced by shrinkTo().

◆ getValueFwdRef()

Value * BitcodeReaderValueList::getValueFwdRef ( unsigned  Idx,
Type Ty 
)

◆ operator[]()

Value* llvm::BitcodeReaderValueList::operator[] ( unsigned  i) const
inline

Definition at line 60 of file ValueList.h.

References assert().

◆ pop_back()

void llvm::BitcodeReaderValueList::pop_back ( )
inline

Definition at line 66 of file ValueList.h.

◆ push_back()

void llvm::BitcodeReaderValueList::push_back ( Value V)
inline

Definition at line 53 of file ValueList.h.

◆ resize()

void llvm::BitcodeReaderValueList::resize ( unsigned  N)
inline

Definition at line 52 of file ValueList.h.

◆ resolveConstantForwardRefs()

void BitcodeReaderValueList::resolveConstantForwardRefs ( )

Once all constants are read, this method bulk resolves any forward references.

The idea behind this is that we sometimes get constants (such as large arrays) which reference many forward ref constants. Replacing each of these causes a lot of thrashing when building/reuniquing the constant. Instead of doing this, we look at all the uses and rewrite all the place holders at once for any constant that uses a placeholder.

Definition at line 144 of file ValueList.cpp.

References assert(), llvm::Constant::destroyConstant(), E, llvm::ConstantArray::get(), llvm::ConstantStruct::get(), llvm::ConstantVector::get(), I, llvm::lower_bound(), llvm::User::op_begin(), llvm::User::op_end(), llvm::Value::replaceAllUsesWith(), llvm::parallel::sort(), and llvm::Value::user_begin().

Referenced by shrinkTo().

◆ shrinkTo()

void llvm::BitcodeReaderValueList::shrinkTo ( unsigned  N)
inline

◆ size()

unsigned llvm::BitcodeReaderValueList::size ( ) const
inline

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