LLVM
15.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 185 of file MemoryBuiltins.h.
ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor | ( | const DataLayout & | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
ObjectSizeOpts | Options = {} |
||
) |
Definition at line 655 of file MemoryBuiltins.cpp.
|
inlinestatic |
Definition at line 214 of file MemoryBuiltins.h.
References knownOffset(), and knownSize().
Referenced by llvm::getObjectSize(), and visitLoadInst().
SizeOffsetType ObjectSizeOffsetVisitor::compute | ( | Value * | V | ) |
Definition at line 664 of file MemoryBuiltins.cpp.
References llvm::DataLayout::getIndexTypeSizeInBits(), llvm::Value::getType(), llvm::APInt::getZero(), knownOffset(), knownSize(), and llvm::Value::stripAndAccumulateConstantOffsets().
Referenced by llvm::getObjectSize(), visitGlobalAlias(), visitPHINode(), and visitSelectInst().
|
inlinestatic |
Definition at line 210 of file MemoryBuiltins.h.
Referenced by bothKnown(), and compute().
|
inlinestatic |
Definition at line 206 of file MemoryBuiltins.h.
Referenced by bothKnown(), and compute().
SizeOffsetType ObjectSizeOffsetVisitor::visitAllocaInst | ( | AllocaInst & | I | ) |
Definition at line 729 of file MemoryBuiltins.cpp.
References llvm::ObjectSizeOpts::EvalMode, llvm::TypeSize::getKnownMinSize(), llvm::DataLayout::getTypeAllocSize(), I, llvm::LinearPolySize< LeafTy >::isScalable(), and llvm::ObjectSizeOpts::Min.
SizeOffsetType ObjectSizeOffsetVisitor::visitArgument | ( | Argument & | A | ) |
Definition at line 754 of file MemoryBuiltins.cpp.
References llvm::DataLayout::getTypeAllocSize(), and llvm::Type::isSized().
SizeOffsetType ObjectSizeOffsetVisitor::visitCallBase | ( | CallBase & | CB | ) |
Definition at line 766 of file MemoryBuiltins.cpp.
References llvm::getAllocSize().
SizeOffsetType ObjectSizeOffsetVisitor::visitConstantPointerNull | ( | ConstantPointerNull & | CPN | ) |
Definition at line 774 of file MemoryBuiltins.cpp.
References llvm::PointerType::getAddressSpace(), llvm::ConstantPointerNull::getType(), and llvm::ObjectSizeOpts::NullIsUnknownSize.
SizeOffsetType ObjectSizeOffsetVisitor::visitExtractElementInst | ( | ExtractElementInst & | I | ) |
Definition at line 788 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitExtractValueInst | ( | ExtractValueInst & | I | ) |
Definition at line 793 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitGlobalAlias | ( | GlobalAlias & | GA | ) |
Definition at line 798 of file MemoryBuiltins.cpp.
References compute(), llvm::GlobalAlias::getAliasee(), and llvm::GlobalValue::isInterposable().
SizeOffsetType ObjectSizeOffsetVisitor::visitGlobalVariable | ( | GlobalVariable & | GV | ) |
Definition at line 804 of file MemoryBuiltins.cpp.
References llvm::GlobalObject::getAlign(), llvm::DataLayout::getTypeAllocSize(), llvm::GlobalValue::getValueType(), and llvm::GlobalVariable::hasDefinitiveInitializer().
SizeOffsetType ObjectSizeOffsetVisitor::visitInstruction | ( | Instruction & | I | ) |
Definition at line 978 of file MemoryBuiltins.cpp.
References llvm::dbgs(), I, and LLVM_DEBUG.
SizeOffsetType ObjectSizeOffsetVisitor::visitIntToPtrInst | ( | IntToPtrInst & | ) |
Definition at line 812 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 927 of file MemoryBuiltins.cpp.
References llvm::ObjectSizeOpts::AA, bothKnown(), and llvm::Instruction::getParent().
SizeOffsetType ObjectSizeOffsetVisitor::visitPHINode | ( | PHINode & | PN | ) |
Definition at line 960 of file MemoryBuiltins.cpp.
References compute(), llvm::PHINode::incoming_values(), and LHS.
SizeOffsetType ObjectSizeOffsetVisitor::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 969 of file MemoryBuiltins.cpp.
SizeOffsetType ObjectSizeOffsetVisitor::visitUndefValue | ( | UndefValue & | ) |
Definition at line 974 of file MemoryBuiltins.cpp.