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 252 of file MemoryBuiltins.h.
ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor | ( | const DataLayout & | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
ObjectSizeOpts | Options = {} |
||
) |
Definition at line 742 of file MemoryBuiltins.cpp.
SizeOffsetAPInt ObjectSizeOffsetVisitor::compute | ( | Value * | V | ) |
Definition at line 751 of file MemoryBuiltins.cpp.
References llvm::OffsetSpan::After, llvm::OffsetSpan::Before, llvm::OffsetSpan::bothKnown(), llvm::ObjectSizeOpts::EvalMode, llvm::ObjectSizeOpts::ExactSizeFromOffset, llvm::APInt::getBitWidth(), llvm::APInt::getZero(), llvm::OffsetSpan::knownAfter(), and llvm::OffsetSpan::knownBefore().
Referenced by llvm::getObjectSize().
OffsetSpan ObjectSizeOffsetVisitor::visitAllocaInst | ( | AllocaInst & | I | ) |
Definition at line 888 of file MemoryBuiltins.cpp.
References aggregatePossibleConstantValues(), llvm::ObjectSizeOpts::EvalMode, llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::DataLayout::getTypeAllocSize(), I, llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::isUIntN(), llvm::ObjectSizeOpts::Min, and Size.
OffsetSpan ObjectSizeOffsetVisitor::visitArgument | ( | Argument & | A | ) |
Definition at line 915 of file MemoryBuiltins.cpp.
References A, llvm::DataLayout::getTypeAllocSize(), llvm::Type::isSized(), and Size.
OffsetSpan ObjectSizeOffsetVisitor::visitCallBase | ( | CallBase & | CB | ) |
Definition at line 927 of file MemoryBuiltins.cpp.
References aggregatePossibleConstantValues(), llvm::ObjectSizeOpts::EvalMode, llvm::getAllocSize(), and Size.
OffsetSpan ObjectSizeOffsetVisitor::visitConstantPointerNull | ( | ConstantPointerNull & | CPN | ) |
Definition at line 949 of file MemoryBuiltins.cpp.
References llvm::PointerType::getAddressSpace(), llvm::ConstantPointerNull::getType(), and llvm::ObjectSizeOpts::NullIsUnknownSize.
OffsetSpan ObjectSizeOffsetVisitor::visitExtractElementInst | ( | ExtractElementInst & | I | ) |
Definition at line 963 of file MemoryBuiltins.cpp.
OffsetSpan ObjectSizeOffsetVisitor::visitExtractValueInst | ( | ExtractValueInst & | I | ) |
Definition at line 967 of file MemoryBuiltins.cpp.
OffsetSpan ObjectSizeOffsetVisitor::visitGlobalAlias | ( | GlobalAlias & | GA | ) |
Definition at line 972 of file MemoryBuiltins.cpp.
References llvm::GlobalAlias::getAliasee(), and llvm::GlobalValue::isInterposable().
OffsetSpan ObjectSizeOffsetVisitor::visitGlobalVariable | ( | GlobalVariable & | GV | ) |
Definition at line 978 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.
OffsetSpan ObjectSizeOffsetVisitor::visitInstruction | ( | Instruction & | I | ) |
Definition at line 1164 of file MemoryBuiltins.cpp.
References llvm::dbgs(), I, and LLVM_DEBUG.
OffsetSpan ObjectSizeOffsetVisitor::visitIntToPtrInst | ( | IntToPtrInst & | ) |
Definition at line 988 of file MemoryBuiltins.cpp.
OffsetSpan ObjectSizeOffsetVisitor::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 1106 of file MemoryBuiltins.cpp.
References llvm::ObjectSizeOpts::AA, llvm::OffsetSpan::bothKnown(), and llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent().
OffsetSpan ObjectSizeOffsetVisitor::visitPHINode | ( | PHINode & | PN | ) |
Definition at line 1144 of file MemoryBuiltins.cpp.
References llvm::PHINode::getNumIncomingValues(), llvm::PHINode::incoming_values(), and LHS.
OffsetSpan ObjectSizeOffsetVisitor::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 1155 of file MemoryBuiltins.cpp.
References I.
OffsetSpan ObjectSizeOffsetVisitor::visitUndefValue | ( | UndefValue & | ) |
Definition at line 1160 of file MemoryBuiltins.cpp.