LLVM  14.0.0git
Public Member Functions | List of all members
llvm::BitcodeReaderValueList Class Reference

#include "Bitcode/Reader/ValueList.h"

Public Member Functions

 BitcodeReaderValueList (LLVMContext &C, size_t RefsUpperBound)
 
 ~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 28 of file ValueList.h.

Constructor & Destructor Documentation

◆ BitcodeReaderValueList()

llvm::BitcodeReaderValueList::BitcodeReaderValueList ( LLVMContext C,
size_t  RefsUpperBound 
)
inline

Definition at line 47 of file ValueList.h.

References Context.

◆ ~BitcodeReaderValueList()

llvm::BitcodeReaderValueList::~BitcodeReaderValueList ( )
inline

Definition at line 52 of file ValueList.h.

References assert().

Member Function Documentation

◆ assignValue()

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

Definition at line 65 of file ValueList.cpp.

References llvm::Value::deleteValue(), push_back(), resize(), and size().

◆ back()

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

Definition at line 73 of file ValueList.h.

◆ clear()

void llvm::BitcodeReaderValueList::clear ( )
inline

Definition at line 63 of file ValueList.h.

References assert().

◆ empty()

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

Definition at line 77 of file ValueList.h.

◆ getConstantFwdRef()

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

Definition at line 93 of file ValueList.cpp.

References llvm::report_fatal_error(), resize(), and size().

◆ getValueFwdRef()

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

Definition at line 113 of file ValueList.cpp.

References resize(), and size().

◆ operator[]()

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

Definition at line 68 of file ValueList.h.

References assert(), and i.

Referenced by resolveConstantForwardRefs().

◆ pop_back()

void llvm::BitcodeReaderValueList::pop_back ( )
inline

Definition at line 74 of file ValueList.h.

◆ push_back()

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

Definition at line 61 of file ValueList.h.

Referenced by assignValue().

◆ resize()

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

Definition at line 58 of file ValueList.h.

References N.

Referenced by assignValue(), getConstantFwdRef(), and getValueFwdRef().

◆ 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::SmallVectorImpl< T >::clear(), 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(), operator[](), llvm::Value::replaceAllUsesWith(), and llvm::sort().

◆ shrinkTo()

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

Definition at line 79 of file ValueList.h.

References assert(), N, and size().

◆ size()

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

Definition at line 57 of file ValueList.h.

Referenced by assignValue(), getConstantFwdRef(), getValueFwdRef(), and shrinkTo().


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