LLVM 20.0.0git
Public Member Functions | List of all members
llvm::ObjectSizeOffsetVisitor Class Reference

Evaluate the size and offset of an object pointed to by a Value* statically. More...

#include "llvm/Analysis/MemoryBuiltins.h"

Inheritance diagram for llvm::ObjectSizeOffsetVisitor:
Inheritance graph
[legend]

Public Member Functions

 ObjectSizeOffsetVisitor (const DataLayout &DL, const TargetLibraryInfo *TLI, LLVMContext &Context, ObjectSizeOpts Options={})
 
SizeOffsetAPInt compute (Value *V)
 
SizeOffsetAPInt visitAllocaInst (AllocaInst &I)
 
SizeOffsetAPInt visitArgument (Argument &A)
 
SizeOffsetAPInt visitCallBase (CallBase &CB)
 
SizeOffsetAPInt visitConstantPointerNull (ConstantPointerNull &)
 
SizeOffsetAPInt visitExtractElementInst (ExtractElementInst &I)
 
SizeOffsetAPInt visitExtractValueInst (ExtractValueInst &I)
 
SizeOffsetAPInt visitGlobalAlias (GlobalAlias &GA)
 
SizeOffsetAPInt visitGlobalVariable (GlobalVariable &GV)
 
SizeOffsetAPInt visitIntToPtrInst (IntToPtrInst &)
 
SizeOffsetAPInt visitLoadInst (LoadInst &I)
 
SizeOffsetAPInt visitPHINode (PHINode &)
 
SizeOffsetAPInt visitSelectInst (SelectInst &I)
 
SizeOffsetAPInt visitUndefValue (UndefValue &)
 
SizeOffsetAPInt visitInstruction (Instruction &I)
 
- Public Member Functions inherited from llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetAPInt >
void visit (Iterator Start, Iterator End)
 
void visit (Module &M)
 
void visit (Function &F)
 
void visit (BasicBlock &BB)
 
void visit (Module *M)
 
void visit (Function *F)
 
void visit (BasicBlock *BB)
 
SizeOffsetAPInt visit (Instruction *I)
 
SizeOffsetAPInt visit (Instruction &I)
 
void visitModule (Module &M)
 
void visitFunction (Function &F)
 
void visitBasicBlock (BasicBlock &BB)
 
SizeOffsetAPInt visitICmpInst (ICmpInst &I)
 
SizeOffsetAPInt visitFCmpInst (FCmpInst &I)
 
SizeOffsetAPInt visitAllocaInst (AllocaInst &I)
 
SizeOffsetAPInt visitLoadInst (LoadInst &I)
 
SizeOffsetAPInt visitStoreInst (StoreInst &I)
 
SizeOffsetAPInt visitAtomicCmpXchgInst (AtomicCmpXchgInst &I)
 
SizeOffsetAPInt visitAtomicRMWInst (AtomicRMWInst &I)
 
SizeOffsetAPInt visitFenceInst (FenceInst &I)
 
SizeOffsetAPInt visitGetElementPtrInst (GetElementPtrInst &I)
 
SizeOffsetAPInt visitPHINode (PHINode &I)
 
SizeOffsetAPInt visitTruncInst (TruncInst &I)
 
SizeOffsetAPInt visitZExtInst (ZExtInst &I)
 
SizeOffsetAPInt visitSExtInst (SExtInst &I)
 
SizeOffsetAPInt visitFPTruncInst (FPTruncInst &I)
 
SizeOffsetAPInt visitFPExtInst (FPExtInst &I)
 
SizeOffsetAPInt visitFPToUIInst (FPToUIInst &I)
 
SizeOffsetAPInt visitFPToSIInst (FPToSIInst &I)
 
SizeOffsetAPInt visitUIToFPInst (UIToFPInst &I)
 
SizeOffsetAPInt visitSIToFPInst (SIToFPInst &I)
 
SizeOffsetAPInt visitPtrToIntInst (PtrToIntInst &I)
 
SizeOffsetAPInt visitIntToPtrInst (IntToPtrInst &I)
 
SizeOffsetAPInt visitBitCastInst (BitCastInst &I)
 
SizeOffsetAPInt visitAddrSpaceCastInst (AddrSpaceCastInst &I)
 
SizeOffsetAPInt visitSelectInst (SelectInst &I)
 
SizeOffsetAPInt visitVAArgInst (VAArgInst &I)
 
SizeOffsetAPInt visitExtractElementInst (ExtractElementInst &I)
 
SizeOffsetAPInt visitInsertElementInst (InsertElementInst &I)
 
SizeOffsetAPInt visitShuffleVectorInst (ShuffleVectorInst &I)
 
SizeOffsetAPInt visitExtractValueInst (ExtractValueInst &I)
 
SizeOffsetAPInt visitInsertValueInst (InsertValueInst &I)
 
SizeOffsetAPInt visitLandingPadInst (LandingPadInst &I)
 
SizeOffsetAPInt visitFuncletPadInst (FuncletPadInst &I)
 
SizeOffsetAPInt visitCleanupPadInst (CleanupPadInst &I)
 
SizeOffsetAPInt visitCatchPadInst (CatchPadInst &I)
 
SizeOffsetAPInt visitFreezeInst (FreezeInst &I)
 
SizeOffsetAPInt visitDbgDeclareInst (DbgDeclareInst &I)
 
SizeOffsetAPInt visitDbgValueInst (DbgValueInst &I)
 
SizeOffsetAPInt visitDbgVariableIntrinsic (DbgVariableIntrinsic &I)
 
SizeOffsetAPInt visitDbgLabelInst (DbgLabelInst &I)
 
SizeOffsetAPInt visitDbgInfoIntrinsic (DbgInfoIntrinsic &I)
 
SizeOffsetAPInt visitMemSetInst (MemSetInst &I)
 
SizeOffsetAPInt visitMemSetInlineInst (MemSetInlineInst &I)
 
SizeOffsetAPInt visitMemCpyInst (MemCpyInst &I)
 
SizeOffsetAPInt visitMemCpyInlineInst (MemCpyInlineInst &I)
 
SizeOffsetAPInt visitMemMoveInst (MemMoveInst &I)
 
SizeOffsetAPInt visitMemTransferInst (MemTransferInst &I)
 
SizeOffsetAPInt visitMemIntrinsic (MemIntrinsic &I)
 
SizeOffsetAPInt visitVAStartInst (VAStartInst &I)
 
SizeOffsetAPInt visitVAEndInst (VAEndInst &I)
 
SizeOffsetAPInt visitVACopyInst (VACopyInst &I)
 
SizeOffsetAPInt visitIntrinsicInst (IntrinsicInst &I)
 
SizeOffsetAPInt visitCallInst (CallInst &I)
 
SizeOffsetAPInt visitInvokeInst (InvokeInst &I)
 
SizeOffsetAPInt visitCallBrInst (CallBrInst &I)
 
SizeOffsetAPInt visitReturnInst (ReturnInst &I)
 
SizeOffsetAPInt visitBranchInst (BranchInst &I)
 
SizeOffsetAPInt visitSwitchInst (SwitchInst &I)
 
SizeOffsetAPInt visitIndirectBrInst (IndirectBrInst &I)
 
SizeOffsetAPInt visitResumeInst (ResumeInst &I)
 
SizeOffsetAPInt visitUnreachableInst (UnreachableInst &I)
 
SizeOffsetAPInt visitCleanupReturnInst (CleanupReturnInst &I)
 
SizeOffsetAPInt visitCatchReturnInst (CatchReturnInst &I)
 
SizeOffsetAPInt visitCatchSwitchInst (CatchSwitchInst &I)
 
SizeOffsetAPInt visitTerminator (Instruction &I)
 
SizeOffsetAPInt visitCastInst (CastInst &I)
 
SizeOffsetAPInt visitUnaryOperator (UnaryOperator &I)
 
SizeOffsetAPInt visitBinaryOperator (BinaryOperator &I)
 
SizeOffsetAPInt visitCmpInst (CmpInst &I)
 
SizeOffsetAPInt visitUnaryInstruction (UnaryInstruction &I)
 
SizeOffsetAPInt visitCallBase (CallBase &I)
 
void visitInstruction (Instruction &I)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ObjectSizeOffsetVisitor()

ObjectSizeOffsetVisitor::ObjectSizeOffsetVisitor ( const DataLayout DL,
const TargetLibraryInfo TLI,
LLVMContext Context,
ObjectSizeOpts  Options = {} 
)

Definition at line 678 of file MemoryBuiltins.cpp.

Member Function Documentation

◆ compute()

SizeOffsetAPInt ObjectSizeOffsetVisitor::compute ( Value V)

Definition at line 687 of file MemoryBuiltins.cpp.

Referenced by llvm::getObjectSize().

◆ visitAllocaInst()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitAllocaInst ( AllocaInst I)

◆ visitArgument()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitArgument ( Argument A)

◆ visitCallBase()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitCallBase ( CallBase CB)

Definition at line 800 of file MemoryBuiltins.cpp.

References llvm::getAllocSize(), and Size.

◆ visitConstantPointerNull()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitConstantPointerNull ( ConstantPointerNull CPN)

◆ visitExtractElementInst()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitExtractElementInst ( ExtractElementInst I)

Definition at line 821 of file MemoryBuiltins.cpp.

◆ visitExtractValueInst()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitExtractValueInst ( ExtractValueInst I)

Definition at line 826 of file MemoryBuiltins.cpp.

◆ visitGlobalAlias()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitGlobalAlias ( GlobalAlias GA)

◆ visitGlobalVariable()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitGlobalVariable ( GlobalVariable GV)

◆ visitInstruction()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitInstruction ( Instruction I)

Definition at line 1020 of file MemoryBuiltins.cpp.

References llvm::dbgs(), I, and LLVM_DEBUG.

◆ visitIntToPtrInst()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitIntToPtrInst ( IntToPtrInst )

Definition at line 848 of file MemoryBuiltins.cpp.

◆ visitLoadInst()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitLoadInst ( LoadInst I)

◆ visitPHINode()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitPHINode ( PHINode PN)

◆ visitSelectInst()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitSelectInst ( SelectInst I)

Definition at line 1011 of file MemoryBuiltins.cpp.

References I.

◆ visitUndefValue()

SizeOffsetAPInt ObjectSizeOffsetVisitor::visitUndefValue ( UndefValue )

Definition at line 1016 of file MemoryBuiltins.cpp.


The documentation for this class was generated from the following files: