LLVM  15.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"

Collaboration diagram for llvm::ObjectSizeOpts:
Collaboration graph
[legend]

Public Types

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

Public Attributes

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

Detailed Description

Various options to control the behavior of getObjectSize.

Definition at line 135 of file MemoryBuiltins.h.

Member Enumeration Documentation

◆ Mode

enum llvm::ObjectSizeOpts::Mode : uint8_t
strong

Controls how we handle conditional statements with unknown conditions.

Enumerator
Exact 

Fail to evaluate an unknown condition.

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

Member Data Documentation

◆ AA

AAResults* llvm::ObjectSizeOpts::AA = nullptr

If set, used for more accurate evaluation.

Definition at line 157 of file MemoryBuiltins.h.

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

◆ EvalMode

Mode llvm::ObjectSizeOpts::EvalMode = Mode::Exact

How we want to evaluate this object's size.

Definition at line 148 of file MemoryBuiltins.h.

Referenced by computePointerICmp(), llvm::lowerObjectSizeCall(), and llvm::ObjectSizeOffsetVisitor::visitAllocaInst().

◆ 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 155 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 151 of file MemoryBuiltins.h.

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


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