LLVM
15.0.0git
|
#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, unsigned TypeID) |
void | clear () |
Value * | operator[] (unsigned i) const |
unsigned | getTypeID (unsigned ValNo) const |
Value * | back () const |
void | pop_back () |
bool | empty () const |
void | shrinkTo (unsigned N) |
Constant * | getConstantFwdRef (unsigned Idx, Type *Ty, unsigned TyID) |
Value * | getValueFwdRef (unsigned Idx, Type *Ty, unsigned TyID) |
Error | assignValue (unsigned Idx, Value *V, unsigned TypeID) |
void | resolveConstantForwardRefs () |
Once all constants are read, this method bulk resolves any forward references. More... | |
Definition at line 29 of file ValueList.h.
|
inline |
Definition at line 49 of file ValueList.h.
References Context.
|
inline |
Definition at line 54 of file ValueList.h.
References assert().
Definition at line 64 of file ValueList.cpp.
References llvm::createStringError(), llvm::Value::deleteValue(), llvm::Value::getType(), push_back(), resize(), size(), and llvm::Error::success().
|
inline |
Definition at line 82 of file ValueList.h.
|
inline |
Definition at line 67 of file ValueList.h.
References assert().
|
inline |
Definition at line 86 of file ValueList.h.
Definition at line 100 of file ValueList.cpp.
References llvm::report_fatal_error(), resize(), and size().
|
inline |
Definition at line 77 of file ValueList.h.
References assert().
Definition at line 121 of file ValueList.cpp.
|
inline |
Definition at line 72 of file ValueList.h.
Referenced by resolveConstantForwardRefs().
|
inline |
Definition at line 83 of file ValueList.h.
|
inline |
Definition at line 63 of file ValueList.h.
Referenced by assignValue().
|
inline |
Definition at line 60 of file ValueList.h.
References N.
Referenced by assignValue(), getConstantFwdRef(), and getValueFwdRef().
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 153 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().
|
inline |
Definition at line 88 of file ValueList.h.
|
inline |
Definition at line 59 of file ValueList.h.
Referenced by assignValue(), getConstantFwdRef(), getValueFwdRef(), and shrinkTo().