LLVM API Documentation
Evaluate the size and offset of an object pointed to by a Value*. May create code to compute the result at run-time. More...
#include <MemoryBuiltins.h>
Public Member Functions | |
ObjectSizeOffsetEvaluator (const DataLayout *DL, const TargetLibraryInfo *TLI, LLVMContext &Context, bool RoundToAlign=false) | |
SizeOffsetEvalType | compute (Value *V) |
bool | knownSize (SizeOffsetEvalType SizeOffset) |
bool | knownOffset (SizeOffsetEvalType SizeOffset) |
bool | anyKnown (SizeOffsetEvalType SizeOffset) |
bool | bothKnown (SizeOffsetEvalType SizeOffset) |
SizeOffsetEvalType | visitAllocaInst (AllocaInst &I) |
SizeOffsetEvalType | visitCallSite (CallSite CS) |
SizeOffsetEvalType | visitExtractElementInst (ExtractElementInst &I) |
SizeOffsetEvalType | visitExtractValueInst (ExtractValueInst &I) |
SizeOffsetEvalType | visitGEPOperator (GEPOperator &GEP) |
SizeOffsetEvalType | visitIntToPtrInst (IntToPtrInst &) |
SizeOffsetEvalType | visitLoadInst (LoadInst &I) |
SizeOffsetEvalType | visitPHINode (PHINode &PHI) |
SizeOffsetEvalType | visitSelectInst (SelectInst &I) |
SizeOffsetEvalType | visitInstruction (Instruction &I) |
Evaluate the size and offset of an object pointed to by a Value*. May create code to compute the result at run-time.
Definition at line 217 of file MemoryBuiltins.h.
ObjectSizeOffsetEvaluator::ObjectSizeOffsetEvaluator | ( | const DataLayout * | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
bool | RoundToAlign = false |
||
) |
Definition at line 592 of file MemoryBuiltins.cpp.
bool llvm::ObjectSizeOffsetEvaluator::anyKnown | ( | SizeOffsetEvalType | SizeOffset | ) | [inline] |
Definition at line 253 of file MemoryBuiltins.h.
References knownOffset(), and knownSize().
Referenced by compute().
bool llvm::ObjectSizeOffsetEvaluator::bothKnown | ( | SizeOffsetEvalType | SizeOffset | ) | [inline] |
Definition at line 257 of file MemoryBuiltins.h.
References knownOffset(), and knownSize().
Referenced by compute(), visitGEPOperator(), visitPHINode(), and visitSelectInst().
Definition at line 602 of file MemoryBuiltins.cpp.
References anyKnown(), llvm::SmallPtrSetImpl< PtrType >::begin(), bothKnown(), llvm::SmallPtrSetImplBase::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::SmallPtrSetImpl< PtrType >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::ConstantInt::get(), llvm::DataLayout::getIntPtrType(), llvm::Value::getType(), and I.
bool llvm::ObjectSizeOffsetEvaluator::knownOffset | ( | SizeOffsetEvalType | SizeOffset | ) | [inline] |
Definition at line 249 of file MemoryBuiltins.h.
Referenced by anyKnown(), and bothKnown().
bool llvm::ObjectSizeOffsetEvaluator::knownSize | ( | SizeOffsetEvalType | SizeOffset | ) | [inline] |
Definition at line 245 of file MemoryBuiltins.h.
Referenced by anyKnown(), and bothKnown().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 678 of file MemoryBuiltins.cpp.
References llvm::IRBuilder< preserveNames, T, Inserter >::CreateMul(), llvm::ConstantInt::get(), llvm::AllocaInst::getAllocatedType(), llvm::AllocaInst::getArraySize(), llvm::DataLayout::getTypeAllocSize(), llvm::AllocaInst::isArrayAllocation(), and llvm::Type::isSized().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 691 of file MemoryBuiltins.cpp.
References AllocFnsTy::AllocTy, AnyAlloc, llvm::IRBuilder< preserveNames, T, Inserter >::CreateMul(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateZExt(), AllocFnsTy::FstParam, getAllocationData(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getArgument(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), AllocFnsTy::SndParam, and StrDupLike.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 723 of file MemoryBuiltins.cpp.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 728 of file MemoryBuiltins.cpp.
Definition at line 733 of file MemoryBuiltins.cpp.
References bothKnown(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateAdd(), llvm::EmitGEPOffset(), and llvm::GEPOperator::getPointerOperand().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 806 of file MemoryBuiltins.cpp.
References llvm::dbgs(), and DEBUG.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 743 of file MemoryBuiltins.cpp.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 748 of file MemoryBuiltins.cpp.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 752 of file MemoryBuiltins.cpp.
References llvm::PHINode::addIncoming(), bothKnown(), llvm::IRBuilder< preserveNames, T, Inserter >::CreatePHI(), llvm::Instruction::eraseFromParent(), llvm::UndefValue::get(), llvm::BasicBlock::getFirstInsertionPt(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), llvm::PHINode::hasConstantValue(), llvm::TargetOpcode::PHI, llvm::Value::replaceAllUsesWith(), and llvm::IRBuilderBase::SetInsertPoint().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >.
Definition at line 790 of file MemoryBuiltins.cpp.
References bothKnown(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateSelect(), llvm::SelectInst::getCondition(), llvm::SelectInst::getFalseValue(), and llvm::SelectInst::getTrueValue().