LLVM  13.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
llvm::MCRegister Class Reference

Wrapper class representing physical registers. Should be passed by value. More...

#include "llvm/MC/MCRegister.h"

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

Public Member Functions

constexpr MCRegister (unsigned Val=0)
 
constexpr operator unsigned () const
 
unsigned id () const
 
bool isValid () const
 
bool operator== (const MCRegister &Other) const
 Comparisons between register objects. More...
 
bool operator!= (const MCRegister &Other) const
 
bool operator== (unsigned Other) const
 Comparisons against register constants. More...
 
bool operator!= (unsigned Other) const
 
bool operator== (int Other) const
 
bool operator!= (int Other) const
 
bool operator== (MCPhysReg Other) const
 
bool operator!= (MCPhysReg Other) const
 

Static Public Member Functions

static bool isStackSlot (unsigned Reg)
 This is the portion of the positive number space that is not a physical register. More...
 
static bool isPhysicalRegister (unsigned Reg)
 Return true if the specified register number is in the physical register namespace. More...
 
static MCRegister from (unsigned Val)
 Check the provided unsigned value is a valid MCRegister. More...
 

Static Public Attributes

static constexpr unsigned NoRegister = 0u
 
static constexpr unsigned FirstPhysicalReg = 1u
 
static constexpr unsigned FirstStackSlot = 1u << 30
 
static constexpr unsigned VirtualRegFlag = 1u << 31
 

Friends

hash_code hash_value (const MCRegister &)
 

Detailed Description

Wrapper class representing physical registers. Should be passed by value.

Definition at line 23 of file MCRegister.h.

Constructor & Destructor Documentation

◆ MCRegister()

constexpr llvm::MCRegister::MCRegister ( unsigned  Val = 0)
inlineconstexpr

Definition at line 28 of file MCRegister.h.

Referenced by from().

Member Function Documentation

◆ from()

static MCRegister llvm::MCRegister::from ( unsigned  Val)
inlinestatic

◆ id()

unsigned llvm::MCRegister::id ( ) const
inline

◆ isPhysicalRegister()

static bool llvm::MCRegister::isPhysicalRegister ( unsigned  Reg)
inlinestatic

Return true if the specified register number is in the physical register namespace.

Definition at line 57 of file MCRegister.h.

References FirstPhysicalReg, and FirstStackSlot.

Referenced by llvm::Register::asMCReg(), from(), llvm::Register::isPhysicalRegister(), and llvm::MCRegUnitIterator::MCRegUnitIterator().

◆ isStackSlot()

static bool llvm::MCRegister::isStackSlot ( unsigned  Reg)
inlinestatic

This is the portion of the positive number space that is not a physical register.

StackSlot values do not exist in the MC layer, see Register::isStackSlot() for the more information on them.

Definition at line 51 of file MCRegister.h.

References FirstStackSlot, and VirtualRegFlag.

Referenced by llvm::Register::isStack(), and llvm::Register::isStackSlot().

◆ isValid()

bool llvm::MCRegister::isValid ( ) const
inline

Definition at line 75 of file MCRegister.h.

References NoRegister.

Referenced by llvm::InterferenceCache::Cursor::setPhysReg().

◆ operator unsigned()

constexpr llvm::MCRegister::operator unsigned ( ) const
inlineconstexpr

Definition at line 61 of file MCRegister.h.

◆ operator!=() [1/4]

bool llvm::MCRegister::operator!= ( const MCRegister Other) const
inline

Definition at line 79 of file MCRegister.h.

References Other.

◆ operator!=() [2/4]

bool llvm::MCRegister::operator!= ( int  Other) const
inline

Definition at line 88 of file MCRegister.h.

References Other.

◆ operator!=() [3/4]

bool llvm::MCRegister::operator!= ( MCPhysReg  Other) const
inline

Definition at line 91 of file MCRegister.h.

References Other.

◆ operator!=() [4/4]

bool llvm::MCRegister::operator!= ( unsigned  Other) const
inline

Definition at line 86 of file MCRegister.h.

References Other.

◆ operator==() [1/4]

bool llvm::MCRegister::operator== ( const MCRegister Other) const
inline

Comparisons between register objects.

Definition at line 78 of file MCRegister.h.

References Other.

◆ operator==() [2/4]

bool llvm::MCRegister::operator== ( int  Other) const
inline

Definition at line 87 of file MCRegister.h.

References Other.

◆ operator==() [3/4]

bool llvm::MCRegister::operator== ( MCPhysReg  Other) const
inline

Definition at line 90 of file MCRegister.h.

References Other.

◆ operator==() [4/4]

bool llvm::MCRegister::operator== ( unsigned  Other) const
inline

Comparisons against register constants.

E.g.

Definition at line 85 of file MCRegister.h.

References Other.

Friends And Related Function Documentation

◆ hash_value

hash_code hash_value ( const MCRegister Reg)
friend

Definition at line 110 of file MCRegister.h.

Member Data Documentation

◆ FirstPhysicalReg

constexpr unsigned llvm::MCRegister::FirstPhysicalReg = 1u
staticconstexpr

Definition at line 43 of file MCRegister.h.

Referenced by isPhysicalRegister().

◆ FirstStackSlot

constexpr unsigned llvm::MCRegister::FirstStackSlot = 1u << 30
staticconstexpr

◆ NoRegister

constexpr unsigned llvm::MCRegister::NoRegister = 0u
staticconstexpr

◆ VirtualRegFlag

constexpr unsigned llvm::MCRegister::VirtualRegFlag = 1u << 31
staticconstexpr

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