LLVM 20.0.0git
|
Evaluate the size and offset of an object pointed to by a Value* statically. More...
#include "llvm/Analysis/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 227 of file MemoryBuiltins.h.
ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor | ( | const DataLayout & | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
ObjectSizeOpts | Options = {} |
||
) |
Definition at line 678 of file MemoryBuiltins.cpp.
SizeOffsetAPInt ObjectSizeOffsetVisitor::compute | ( | Value * | V | ) |
Definition at line 687 of file MemoryBuiltins.cpp.
Referenced by llvm::getObjectSize().
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitAllocaInst | ( | AllocaInst & | I | ) |
Definition at line 766 of file MemoryBuiltins.cpp.
References llvm::CallingConv::C, llvm::ObjectSizeOpts::EvalMode, llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::DataLayout::getTypeAllocSize(), I, llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::ObjectSizeOpts::Min, and Size.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitArgument | ( | Argument & | A | ) |
Definition at line 788 of file MemoryBuiltins.cpp.
References A, llvm::DataLayout::getTypeAllocSize(), llvm::Type::isSized(), and Size.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitCallBase | ( | CallBase & | CB | ) |
Definition at line 800 of file MemoryBuiltins.cpp.
References llvm::getAllocSize(), and Size.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitConstantPointerNull | ( | ConstantPointerNull & | CPN | ) |
Definition at line 807 of file MemoryBuiltins.cpp.
References llvm::PointerType::getAddressSpace(), llvm::ConstantPointerNull::getType(), and llvm::ObjectSizeOpts::NullIsUnknownSize.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitExtractElementInst | ( | ExtractElementInst & | I | ) |
Definition at line 821 of file MemoryBuiltins.cpp.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitExtractValueInst | ( | ExtractValueInst & | I | ) |
Definition at line 826 of file MemoryBuiltins.cpp.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitGlobalAlias | ( | GlobalAlias & | GA | ) |
Definition at line 831 of file MemoryBuiltins.cpp.
References llvm::GlobalAlias::getAliasee(), and llvm::GlobalValue::isInterposable().
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitGlobalVariable | ( | GlobalVariable & | GV | ) |
Definition at line 838 of file MemoryBuiltins.cpp.
References llvm::ObjectSizeOpts::EvalMode, llvm::GlobalObject::getAlign(), llvm::DataLayout::getTypeAllocSize(), llvm::GlobalValue::getValueType(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::GlobalVariable::hasInitializer(), llvm::GlobalValue::isInterposable(), llvm::Type::isSized(), llvm::ObjectSizeOpts::Min, and Size.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitInstruction | ( | Instruction & | I | ) |
Definition at line 1020 of file MemoryBuiltins.cpp.
References llvm::dbgs(), I, and LLVM_DEBUG.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitIntToPtrInst | ( | IntToPtrInst & | ) |
Definition at line 848 of file MemoryBuiltins.cpp.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 963 of file MemoryBuiltins.cpp.
References llvm::ObjectSizeOpts::AA, llvm::SizeOffsetType< T, C >::bothKnown(), and llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent().
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitPHINode | ( | PHINode & | PN | ) |
Definition at line 1000 of file MemoryBuiltins.cpp.
References llvm::PHINode::getNumIncomingValues(), llvm::PHINode::incoming_values(), and LHS.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 1011 of file MemoryBuiltins.cpp.
References I.
SizeOffsetAPInt ObjectSizeOffsetVisitor::visitUndefValue | ( | UndefValue & | ) |
Definition at line 1016 of file MemoryBuiltins.cpp.