LLVM  14.0.0git
Public Member Functions | List of all members
llvm::RegOrConstant Class Reference

Represents a value which can be a Register or a constant. More...

#include "llvm/CodeGen/GlobalISel/Utils.h"

Public Member Functions

 RegOrConstant (Register Reg)
 
 RegOrConstant (int64_t Cst)
 
bool isReg () const
 
bool isCst () const
 
Register getReg () const
 
int64_t getCst () const
 

Detailed Description

Represents a value which can be a Register or a constant.

This is useful in situations where an instruction may have an interesting register operand or interesting constant operand. For a concrete example,

See also
getVectorSplat.

Definition at line 347 of file Utils.h.

Constructor & Destructor Documentation

◆ RegOrConstant() [1/2]

llvm::RegOrConstant::RegOrConstant ( Register  Reg)
inlineexplicit

Definition at line 353 of file Utils.h.

◆ RegOrConstant() [2/2]

llvm::RegOrConstant::RegOrConstant ( int64_t  Cst)
inlineexplicit

Definition at line 354 of file Utils.h.

Member Function Documentation

◆ getCst()

int64_t llvm::RegOrConstant::getCst ( ) const
inline

Definition at line 361 of file Utils.h.

References assert(), and isCst().

◆ getReg()

Register llvm::RegOrConstant::getReg ( ) const
inline

Definition at line 357 of file Utils.h.

References assert(), and isReg().

◆ isCst()

bool llvm::RegOrConstant::isCst ( ) const
inline

Definition at line 356 of file Utils.h.

Referenced by getCst().

◆ isReg()

bool llvm::RegOrConstant::isReg ( ) const
inline

Definition at line 355 of file Utils.h.

Referenced by getReg().


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