LLVM  8.0.1
Public Member Functions | Static 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]
Collaboration diagram for llvm::ObjectSizeOffsetVisitor:
Collaboration graph
[legend]

Public Member Functions

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

Static Public Member Functions

static bool knownSize (const SizeOffsetType &SizeOffset)
 
static bool knownOffset (const SizeOffsetType &SizeOffset)
 
static bool bothKnown (const SizeOffsetType &SizeOffset)
 

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 194 of file MemoryBuiltins.h.

Constructor & Destructor Documentation

◆ ObjectSizeOffsetVisitor()

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

Definition at line 490 of file MemoryBuiltins.cpp.

Member Function Documentation

◆ bothKnown()

static bool llvm::ObjectSizeOffsetVisitor::bothKnown ( const SizeOffsetType SizeOffset)
inlinestatic

◆ compute()

SizeOffsetType ObjectSizeOffsetVisitor::compute ( Value V)

◆ knownOffset()

static bool llvm::ObjectSizeOffsetVisitor::knownOffset ( const SizeOffsetType SizeOffset)
inlinestatic

Definition at line 219 of file MemoryBuiltins.h.

◆ knownSize()

static bool llvm::ObjectSizeOffsetVisitor::knownSize ( const SizeOffsetType SizeOffset)
inlinestatic

Definition at line 215 of file MemoryBuiltins.h.

◆ visitAllocaInst()

SizeOffsetType ObjectSizeOffsetVisitor::visitAllocaInst ( AllocaInst I)

◆ visitArgument()

SizeOffsetType ObjectSizeOffsetVisitor::visitArgument ( Argument A)

◆ visitCallSite()

SizeOffsetType ObjectSizeOffsetVisitor::visitCallSite ( CallSite  CS)

◆ visitConstantPointerNull()

SizeOffsetType ObjectSizeOffsetVisitor::visitConstantPointerNull ( ConstantPointerNull CPN)

◆ visitExtractElementInst()

SizeOffsetType ObjectSizeOffsetVisitor::visitExtractElementInst ( ExtractElementInst I)

Definition at line 658 of file MemoryBuiltins.cpp.

◆ visitExtractValueInst()

SizeOffsetType ObjectSizeOffsetVisitor::visitExtractValueInst ( ExtractValueInst I)

Definition at line 663 of file MemoryBuiltins.cpp.

◆ visitGEPOperator()

SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator ( GEPOperator GEP)

◆ visitGlobalAlias()

SizeOffsetType ObjectSizeOffsetVisitor::visitGlobalAlias ( GlobalAlias GA)

◆ visitGlobalVariable()

SizeOffsetType ObjectSizeOffsetVisitor::visitGlobalVariable ( GlobalVariable GV)

◆ visitInstruction()

SizeOffsetType ObjectSizeOffsetVisitor::visitInstruction ( Instruction I)

Definition at line 738 of file MemoryBuiltins.cpp.

References llvm::dbgs(), and LLVM_DEBUG.

◆ visitIntToPtrInst()

SizeOffsetType ObjectSizeOffsetVisitor::visitIntToPtrInst ( IntToPtrInst )

Definition at line 691 of file MemoryBuiltins.cpp.

◆ visitLoadInst()

SizeOffsetType ObjectSizeOffsetVisitor::visitLoadInst ( LoadInst I)

Definition at line 696 of file MemoryBuiltins.cpp.

◆ visitPHINode()

SizeOffsetType ObjectSizeOffsetVisitor::visitPHINode ( PHINode )

Definition at line 701 of file MemoryBuiltins.cpp.

◆ visitSelectInst()

SizeOffsetType ObjectSizeOffsetVisitor::visitSelectInst ( SelectInst I)

◆ visitUndefValue()

SizeOffsetType ObjectSizeOffsetVisitor::visitUndefValue ( UndefValue )

Definition at line 734 of file MemoryBuiltins.cpp.

Referenced by compute().


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