LLVM  8.0.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::Use Class Reference

A Use represents the edge between a Value definition and its users. More...

#include "llvm/IR/Use.h"

Classes

struct  PrevPointerTraits
 Pointer traits for the Prev PointerIntPair. More...
 
struct  UserRefPointerTraits
 Pointer traits for the UserRef PointerIntPair. More...
 

Public Types

using UserRef = PointerIntPair< User *, 1, unsigned, UserRefPointerTraits >
 

Public Member Functions

 Use (const Use &U)=delete
 
void swap (Use &RHS)
 Provide a fast substitute to std::swap<Use> that also works with less standard-compliant compilers. More...
 
 operator Value * () const
 
Valueget () const
 
UsergetUser () const LLVM_READONLY
 Returns the User that contains this Use. More...
 
void set (Value *Val)
 
Valueoperator= (Value *RHS)
 
const Useoperator= (const Use &RHS)
 
Valueoperator-> ()
 
const Valueoperator-> () const
 
UsegetNext () const
 
unsigned getOperandNo () const
 Return the operand # of this use in its User. More...
 

Static Public Member Functions

static UseinitTags (Use *Start, Use *Stop)
 Initializes the waymarking tags on an array of Uses. More...
 
static void zap (Use *Start, const Use *Stop, bool del=false)
 Destroys Use operands when the number of operands of a User changes. More...
 

Friends

class Value
 

Detailed Description

A Use represents the edge between a Value definition and its users.

This is notionally a two-dimensional linked list. It supports traversing all of the uses for a particular value definition. It also supports jumping directly to the used value when we arrive from the User's operands, and jumping directly to the User when we arrive from the Value's uses.

The pointer to the used Value is explicit, and the pointer to the User is implicit. The implicit pointer is found via a waymarking algorithm described in the programmer's manual:

http://www.llvm.org/docs/ProgrammersManual.html#the-waymarking-algorithm

This is essentially the single most memory intensive object in LLVM because of the number of uses in the system. At the same time, the constant time operations it allows are essential to many optimizations having reasonable time complexity.

Definition at line 56 of file Use.h.

Member Typedef Documentation

◆ UserRef

Definition at line 78 of file Use.h.

Constructor & Destructor Documentation

◆ Use()

llvm::Use::Use ( const Use U)
delete

Member Function Documentation

◆ get()

Value* llvm::Use::get ( ) const
inline

◆ getNext()

Use* llvm::Use::getNext ( ) const
inline

Definition at line 124 of file Use.h.

References getOperandNo(), and initTags().

◆ getOperandNo()

unsigned llvm::Use::getOperandNo ( ) const

Return the operand # of this use in its User.

Definition at line 48 of file Use.cpp.

References getUser(), and llvm::User::op_begin().

Referenced by allUsesTruncate(), createCallInst(), getNext(), isCompatibleReplacement(), isSimplePointerUseValidToReplace(), isUseSafeToFold(), and tryFoldInst().

◆ getUser()

User * llvm::Use::getUser ( ) const

◆ initTags()

Use * llvm::Use::initTags ( Use Start,
Use Stop 
)
static

Initializes the waymarking tags on an array of Uses.

This sets up the array of Uses such that getUser() can find the User from any of those Uses.

Definition at line 57 of file Use.cpp.

Referenced by getNext().

◆ operator Value *()

llvm::Use::operator Value * ( ) const
inline

Definition at line 107 of file Use.h.

◆ operator->() [1/2]

Value* llvm::Use::operator-> ( )
inline

Definition at line 121 of file Use.h.

◆ operator->() [2/2]

const Value* llvm::Use::operator-> ( ) const
inline

Definition at line 122 of file Use.h.

◆ operator=() [1/2]

Value * llvm::Use::operator= ( Value RHS)
inline

Definition at line 677 of file Value.h.

Referenced by get().

◆ operator=() [2/2]

const Use & llvm::Use::operator= ( const Use RHS)
inline

Definition at line 682 of file Value.h.

◆ set()

void llvm::Use::set ( Value Val)
inline

◆ swap()

void llvm::Use::swap ( Use RHS)

Provide a fast substitute to std::swap<Use> that also works with less standard-compliant compilers.

Definition at line 17 of file Use.cpp.

References llvm::Value::addUse().

◆ zap()

void llvm::Use::zap ( Use Start,
const Use Stop,
bool  del = false 
)
static

Destroys Use operands when the number of operands of a User changes.

Definition at line 87 of file Use.cpp.

Referenced by llvm::User::growHungoffUses(), and llvm::User::operator delete().

Friends And Related Function Documentation

◆ Value

friend class Value
friend

Definition at line 105 of file Use.h.


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