LLVM 17.0.0git
|
Evaluate the size and offset of an object pointed to by a Value* statically. More...
#include "llvm/Analysis/MemoryBuiltins.h"
Static Public Member Functions | |
static bool | knownSize (const SizeOffsetType &SizeOffset) |
static bool | knownOffset (const SizeOffsetType &SizeOffset) |
static bool | bothKnown (const SizeOffsetType &SizeOffset) |
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 193 of file MemoryBuiltins.h.
ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor | ( | const DataLayout & | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
ObjectSizeOpts | Options = {} |
||
) |
Definition at line 683 of file MemoryBuiltins.cpp.
|
inlinestatic |
Definition at line 222 of file MemoryBuiltins.h.
References knownOffset(), and knownSize().
Referenced by llvm::getObjectSize(), and visitLoadInst().
SizeOffsetType ObjectSizeOffsetVisitor::compute | ( | Value * | V | ) |
Definition at line 692 of file MemoryBuiltins.cpp.
References llvm::DataLayout::getIndexTypeSizeInBits(), llvm::APInt::getZero(), knownOffset(), knownSize(), and llvm::Offset.
Referenced by llvm::getObjectSize(), visitGlobalAlias(), visitPHINode(), and visitSelectInst().
|
inlinestatic |
Definition at line 218 of file MemoryBuiltins.h.
Referenced by bothKnown(), and compute().
|
inlinestatic |
Definition at line 214 of file MemoryBuiltins.h.
Referenced by bothKnown(), and compute().
SizeOffsetType ObjectSizeOffsetVisitor::visitAllocaInst | ( | AllocaInst & | I | ) |
Definition at line 757 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.
SizeOffsetType ObjectSizeOffsetVisitor::visitArgument | ( | Argument & | A | ) |
Definition at line 779 of file MemoryBuiltins.cpp.
References A, llvm::DataLayout::getTypeAllocSize(), llvm::Type::isSized(), and Size.
SizeOffsetType ObjectSizeOffsetVisitor::visitCallBase | ( | CallBase & | CB | ) |
Definition at line 791 of file MemoryBuiltins.cpp.
References llvm::getAllocSize(), and Size.
SizeOffsetType ObjectSizeOffsetVisitor::visitConstantPointerNull | ( | ConstantPointerNull & | CPN | ) |
Definition at line 798 of file MemoryBuiltins.cpp.
References llvm::PointerType::getAddressSpace(), llvm::ConstantPointerNull::getType(), and llvm::ObjectSizeOpts::NullIsUnknownSize.
SizeOffsetType ObjectSizeOffsetVisitor::visitExtractElementInst | ( | ExtractElementInst & | I | ) |
Definition at line 812 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitExtractValueInst | ( | ExtractValueInst & | I | ) |
Definition at line 817 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitGlobalAlias | ( | GlobalAlias & | GA | ) |
Definition at line 822 of file MemoryBuiltins.cpp.
References compute(), llvm::GlobalAlias::getAliasee(), and llvm::GlobalValue::isInterposable().
SizeOffsetType ObjectSizeOffsetVisitor::visitGlobalVariable | ( | GlobalVariable & | GV | ) |
Definition at line 828 of file MemoryBuiltins.cpp.
References llvm::GlobalObject::getAlign(), llvm::DataLayout::getTypeAllocSize(), llvm::GlobalValue::getValueType(), llvm::GlobalVariable::hasDefinitiveInitializer(), and Size.
SizeOffsetType ObjectSizeOffsetVisitor::visitInstruction | ( | Instruction & | I | ) |
Definition at line 1004 of file MemoryBuiltins.cpp.
References llvm::dbgs(), I, and LLVM_DEBUG.
SizeOffsetType ObjectSizeOffsetVisitor::visitIntToPtrInst | ( | IntToPtrInst & | ) |
Definition at line 836 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 951 of file MemoryBuiltins.cpp.
References llvm::ObjectSizeOpts::AA, bothKnown(), and llvm::Instruction::getParent().
SizeOffsetType ObjectSizeOffsetVisitor::visitPHINode | ( | PHINode & | PN | ) |
Definition at line 986 of file MemoryBuiltins.cpp.
References compute(), llvm::PHINode::incoming_values(), and LHS.
SizeOffsetType ObjectSizeOffsetVisitor::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 995 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitUndefValue | ( | UndefValue & | ) |
Definition at line 1000 of file MemoryBuiltins.cpp.