LLVM 19.0.0git
Public Types | Public Attributes | List of all members
llvm::ObjectSizeOpts Struct Reference

Various options to control the behavior of getObjectSize. More...

#include "llvm/Analysis/MemoryBuiltins.h"

Public Types

enum class  Mode : uint8_t { ExactSizeFromOffset , ExactUnderlyingSizeAndOffset , Min , Max }
 Controls how we handle conditional statements with unknown conditions. More...
 

Public Attributes

Mode EvalMode = Mode::ExactSizeFromOffset
 How we want to evaluate this object's size.
 
bool RoundToAlign = false
 Whether to round the result up to the alignment of allocas, byval arguments, and global variables.
 
bool NullIsUnknownSize = false
 If this is true, null pointers in address space 0 will be treated as though they can't be evaluated.
 
AAResultsAA = nullptr
 If set, used for more accurate evaluation.
 

Detailed Description

Various options to control the behavior of getObjectSize.

Definition at line 139 of file MemoryBuiltins.h.

Member Enumeration Documentation

◆ Mode

enum class llvm::ObjectSizeOpts::Mode : uint8_t
strong

Controls how we handle conditional statements with unknown conditions.

Enumerator
ExactSizeFromOffset 

All branches must be known and have the same size, starting from the offset, to be merged.

ExactUnderlyingSizeAndOffset 

All branches must be known and have the same underlying size and offset to be merged.

Min 

Evaluate all branches of an unknown condition.

If all evaluations succeed, pick the minimum size.

Max 

Same as Min, except we pick the maximum size of all of the branches.

Definition at line 141 of file MemoryBuiltins.h.

Member Data Documentation

◆ AA

AAResults* llvm::ObjectSizeOpts::AA = nullptr

If set, used for more accurate evaluation.

Definition at line 165 of file MemoryBuiltins.h.

Referenced by llvm::lowerObjectSizeCall(), and llvm::ObjectSizeOffsetVisitor::visitLoadInst().

◆ EvalMode

Mode llvm::ObjectSizeOpts::EvalMode = Mode::ExactSizeFromOffset

◆ NullIsUnknownSize

bool llvm::ObjectSizeOpts::NullIsUnknownSize = false

If this is true, null pointers in address space 0 will be treated as though they can't be evaluated.

Otherwise, null is always considered to point to a 0 byte region of memory.

Definition at line 163 of file MemoryBuiltins.h.

Referenced by computePointerICmp(), getObjectSize(), getPointerSize(), isDereferenceableAndAlignedPointer(), llvm::lowerObjectSizeCall(), and llvm::ObjectSizeOffsetVisitor::visitConstantPointerNull().

◆ RoundToAlign

bool llvm::ObjectSizeOpts::RoundToAlign = false

Whether to round the result up to the alignment of allocas, byval arguments, and global variables.

Definition at line 159 of file MemoryBuiltins.h.

Referenced by addBoundsChecking(), getObjectSize(), and isDereferenceableAndAlignedPointer().


The documentation for this struct was generated from the following file: