LLVM
8.0.1
|
Evaluate the size and offset of an object pointed to by a Value*. More...
#include "llvm/Analysis/MemoryBuiltins.h"
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 253 of file MemoryBuiltins.h.
ObjectSizeOffsetEvaluator::ObjectSizeOffsetEvaluator | ( | const DataLayout & | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
bool | RoundToAlign = false |
||
) |
Definition at line 744 of file MemoryBuiltins.cpp.
|
inline |
Definition at line 290 of file MemoryBuiltins.h.
Referenced by compute().
|
inline |
Definition at line 294 of file MemoryBuiltins.h.
References GEP.
Referenced by compute(), getBoundsCheckCond(), visitGEPOperator(), visitPHINode(), and visitSelectInst().
SizeOffsetEvalType ObjectSizeOffsetEvaluator::compute | ( | Value * | V | ) |
Definition at line 753 of file MemoryBuiltins.cpp.
References anyKnown(), llvm::ObjectSizeOffsetVisitor::bothKnown(), bothKnown(), llvm::SmallPtrSetImplBase::clear(), llvm::ObjectSizeOffsetVisitor::compute(), llvm::dbgs(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), GEP, llvm::ConstantInt::get(), llvm::DataLayout::getIntPtrType(), getOpcode(), llvm::Value::getType(), llvm::SmallPtrSetImpl< PtrType >::insert(), LLVM_DEBUG, llvm::ObjectSizeOpts::RoundToAlign, llvm::IRBuilderBase::SetInsertPoint(), llvm::Value::stripPointerCasts(), llvm::InstVisitor< ObjectSizeOffsetEvaluator, SizeOffsetEvalType >::visit(), and visitGEPOperator().
Referenced by getBoundsCheckCond().
|
inline |
Definition at line 286 of file MemoryBuiltins.h.
|
inline |
Definition at line 282 of file MemoryBuiltins.h.
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitAllocaInst | ( | AllocaInst & | I | ) |
Definition at line 830 of file MemoryBuiltins.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::ConstantInt::get(), llvm::AllocaInst::getAllocatedType(), llvm::AllocaInst::getArraySize(), llvm::DataLayout::getTypeAllocSize(), llvm::AllocaInst::isArrayAllocation(), and llvm::Type::isSized().
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitCallSite | ( | CallSite | CS | ) |
Definition at line 843 of file MemoryBuiltins.cpp.
References AllocFnsTy::AllocTy, llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::IRBuilder< T, Inserter >::CreateZExt(), AllocFnsTy::FstParam, getAllocationSize(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getArgument(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), AllocFnsTy::SndParam, and StrDupLike.
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitExtractElementInst | ( | ExtractElementInst & | I | ) |
Definition at line 874 of file MemoryBuiltins.cpp.
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitExtractValueInst | ( | ExtractValueInst & | I | ) |
Definition at line 879 of file MemoryBuiltins.cpp.
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitGEPOperator | ( | GEPOperator & | GEP | ) |
Definition at line 884 of file MemoryBuiltins.cpp.
References bothKnown(), llvm::IRBuilder< T, Inserter >::CreateAdd(), llvm::EmitGEPOffset(), and llvm::GEPOperator::getPointerOperand().
Referenced by compute().
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitInstruction | ( | Instruction & | I | ) |
Definition at line 957 of file MemoryBuiltins.cpp.
References llvm::dbgs(), and LLVM_DEBUG.
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitIntToPtrInst | ( | IntToPtrInst & | ) |
Definition at line 894 of file MemoryBuiltins.cpp.
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 899 of file MemoryBuiltins.cpp.
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitPHINode | ( | PHINode & | PHI | ) |
Definition at line 903 of file MemoryBuiltins.cpp.
References llvm::PHINode::addIncoming(), bothKnown(), llvm::IRBuilder< 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::Value::replaceAllUsesWith(), and llvm::IRBuilderBase::SetInsertPoint().
SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 941 of file MemoryBuiltins.cpp.
References bothKnown(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::SelectInst::getCondition(), llvm::SelectInst::getFalseValue(), and llvm::SelectInst::getTrueValue().