LLVM API Documentation
Evaluate the size and offset of an object pointed to by a Value* statically. Fails if size or offset are not known at compile time. More...
#include <MemoryBuiltins.h>
Evaluate the size and offset of an object pointed to by a Value* statically. Fails if size or offset are not known at compile time.
Definition at line 159 of file MemoryBuiltins.h.
ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor | ( | const DataLayout * | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
bool | RoundToAlign = false |
||
) |
Definition at line 398 of file MemoryBuiltins.cpp.
bool llvm::ObjectSizeOffsetVisitor::bothKnown | ( | SizeOffsetType & | SizeOffset | ) | [inline] |
Definition at line 189 of file MemoryBuiltins.h.
References knownOffset(), and knownSize().
Referenced by visitGEPOperator(), and visitSelectInst().
Definition at line 407 of file MemoryBuiltins.cpp.
References llvm::ARM_PROC::A, llvm::WinEH::CE, llvm::dbgs(), DEBUG, llvm::APInt::getNullValue(), llvm::DataLayout::getPointerTypeSizeInBits(), llvm::Value::getType(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::IntToPtr, P, llvm::Value::stripPointerCasts(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), visitArgument(), visitConstantPointerNull(), visitGEPOperator(), visitGlobalAlias(), visitGlobalVariable(), and visitUndefValue().
Referenced by llvm::getObjectSize(), visitGEPOperator(), visitGlobalAlias(), and visitSelectInst().
bool llvm::ObjectSizeOffsetVisitor::knownOffset | ( | SizeOffsetType & | SizeOffset | ) | [inline] |
Definition at line 185 of file MemoryBuiltins.h.
Referenced by bothKnown().
bool llvm::ObjectSizeOffsetVisitor::knownSize | ( | SizeOffsetType & | SizeOffset | ) | [inline] |
Definition at line 181 of file MemoryBuiltins.h.
Referenced by bothKnown().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 444 of file MemoryBuiltins.cpp.
References llvm::CallingConv::C, llvm::AllocaInst::getAlignment(), llvm::AllocaInst::getAllocatedType(), llvm::AllocaInst::getArraySize(), llvm::DataLayout::getTypeAllocSize(), llvm::AllocaInst::isArrayAllocation(), and llvm::Type::isSized().
Definition at line 460 of file MemoryBuiltins.cpp.
References llvm::SequentialType::getElementType(), llvm::Argument::getParamAlignment(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), and llvm::Argument::hasByValOrInAllocaAttr().
Referenced by compute().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 471 of file MemoryBuiltins.cpp.
References AllocFnsTy::AllocTy, AnyAlloc, llvm::dyn_cast(), AllocFnsTy::FstParam, getAllocationData(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getArgument(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::GetStringLength(), llvm::ConstantInt::getValue(), AllocFnsTy::SndParam, StrDupLike, llvm::APInt::ugt(), and llvm::APInt::zextOrSelf().
Definition at line 522 of file MemoryBuiltins.cpp.
Referenced by compute().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 527 of file MemoryBuiltins.cpp.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 532 of file MemoryBuiltins.cpp.
Definition at line 537 of file MemoryBuiltins.cpp.
References llvm::GEPOperator::accumulateConstantOffset(), bothKnown(), compute(), and llvm::GEPOperator::getPointerOperand().
Referenced by compute().
Definition at line 546 of file MemoryBuiltins.cpp.
References compute(), llvm::GlobalAlias::getAliasee(), and llvm::GlobalValue::mayBeOverridden().
Referenced by compute().
Definition at line 552 of file MemoryBuiltins.cpp.
References llvm::GlobalObject::getAlignment(), llvm::SequentialType::getElementType(), llvm::GlobalValue::getType(), llvm::DataLayout::getTypeAllocSize(), and llvm::GlobalVariable::hasDefinitiveInitializer().
Referenced by compute().
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 587 of file MemoryBuiltins.cpp.
References llvm::dbgs(), and DEBUG.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 560 of file MemoryBuiltins.cpp.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 565 of file MemoryBuiltins.cpp.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 570 of file MemoryBuiltins.cpp.
Reimplemented from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >.
Definition at line 575 of file MemoryBuiltins.cpp.
References bothKnown(), compute(), llvm::SelectInst::getFalseValue(), and llvm::SelectInst::getTrueValue().
Definition at line 583 of file MemoryBuiltins.cpp.
Referenced by compute().