LLVM 22.0.0git
Public Types | Static Public Member Functions | List of all members
llvm::MCBinaryExpr Class Reference

Binary assembler expressions. More...

#include "llvm/MC/MCExpr.h"

Inheritance diagram for llvm::MCBinaryExpr:
[legend]

Public Types

enum  Opcode {
  Add , And , Div , EQ ,
  GT , GTE , LAnd , LOr ,
  LT , LTE , Mod , Mul ,
  NE , Or , OrNot , Shl ,
  AShr , LShr , Sub , Xor
}
 
- Public Types inherited from llvm::MCExpr
enum  ExprKind : uint8_t {
  Binary , Constant , SymbolRef , Unary ,
  Specifier , Target
}
 

Public Member Functions

Accessors
Opcode getOpcode () const
 Get the kind of this binary expression.
 
const MCExprgetLHS () const
 Get the left-hand side expression of the binary operator.
 
const MCExprgetRHS () const
 Get the right-hand side expression of the binary operator.
 
- Public Member Functions inherited from llvm::MCExpr
 MCExpr (const MCExpr &)=delete
 
MCExproperator= (const MCExpr &)=delete
 
ExprKind getKind () const
 
SMLoc getLoc () const
 
LLVM_ABI void dump () const
 
LLVM_ABI bool evaluateAsAbsolute (int64_t &Res) const
 Try to evaluate the expression to an absolute value.
 
LLVM_ABI bool evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const
 
LLVM_ABI bool evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const
 
LLVM_ABI bool evaluateKnownAbsolute (int64_t &Res, const MCAssembler &Asm) const
 Aggressive variant of evaluateAsRelocatable when relocations are unavailable (e.g.
 
LLVM_ABI bool evaluateAsRelocatable (MCValue &Res, const MCAssembler *Asm) const
 Try to evaluate the expression to a relocatable value, i.e.
 
LLVM_ABI bool evaluateAsValue (MCValue &Res, const MCAssembler &Asm) const
 Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables.
 
LLVM_ABI MCFragmentfindAssociatedFragment () const
 Find the "associated section" for this expression, which is currently defined as the absolute section for constants, or otherwise the section associated with the first defined symbol in the expression.
 

Static Public Member Functions

static bool classof (const MCExpr *E)
 
Construction
static LLVM_ABI const MCBinaryExprcreate (Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
 
static const MCBinaryExprcreateAdd (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
 
static const MCBinaryExprcreateAnd (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateDiv (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateEQ (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateGT (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateGTE (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateLAnd (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateLOr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateLT (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateLTE (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateMod (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateMul (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateNE (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateOr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateShl (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateAShr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateLShr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateSub (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExprcreateXor (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
- Static Public Member Functions inherited from llvm::MCExpr
static LLVM_ABI bool evaluateSymbolicAdd (const MCAssembler *, bool, const MCValue &, const MCValue &, MCValue &)
 

Additional Inherited Members

- Protected Types inherited from llvm::MCExpr
using Spec = uint16_t
 
- Protected Member Functions inherited from llvm::MCExpr
 MCExpr (ExprKind Kind, SMLoc Loc, unsigned SubclassData=0)
 
LLVM_ABI bool evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, bool InSet) const
 
unsigned getSubclassData () const
 

Detailed Description

Binary assembler expressions.

Definition at line 299 of file MCExpr.h.

Member Enumeration Documentation

◆ Opcode

Enumerator
Add 

Addition.

And 

Bitwise and.

Div 

Signed division.

EQ 

Equality comparison.

GT 

Signed greater than comparison (result is either 0 or some target-specific non-zero value)

GTE 

Signed greater than or equal comparison (result is either 0 or some target-specific non-zero value).

LAnd 

Logical and.

LOr 

Logical or.

LT 

Signed less than comparison (result is either 0 or some target-specific non-zero value).

LTE 

Signed less than or equal comparison (result is either 0 or some target-specific non-zero value).

Mod 

Signed remainder.

Mul 

Multiplication.

NE 

Inequality comparison.

Or 

Bitwise or.

OrNot 

Bitwise or not.

Shl 

Shift left.

AShr 

Arithmetic shift right.

LShr 

Logical shift right.

Sub 

Subtraction.

Xor 

Bitwise exclusive or.

Definition at line 301 of file MCExpr.h.

Member Function Documentation

◆ classof()

static bool llvm::MCBinaryExpr::classof ( const MCExpr E)
inlinestatic

Definition at line 453 of file MCExpr.h.

References llvm::MCExpr::Binary, and E.

◆ create()

const MCBinaryExpr * MCBinaryExpr::create ( Opcode  Op,
const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx,
SMLoc  Loc = SMLoc() 
)
static

◆ createAdd()

static const MCBinaryExpr * llvm::MCBinaryExpr::createAdd ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx,
SMLoc  Loc = SMLoc() 
)
inlinestatic

Definition at line 343 of file MCExpr.h.

References Add, create(), LHS, and RHS.

Referenced by createPCXRelExprOp(), llvm::MCResourceInfo::createTotalNumSGPRs(), llvm::AMDGPUTargetAsmStreamer::EmitAmdhsaKernelDescriptor(), llvm::MCWinCOFFStreamer::emitCOFFImgRel32(), llvm::MCWinCOFFStreamer::emitCOFFSecRel32(), llvm::ARMAsmPrinter::emitInstruction(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::AsmPrinter::emitLabelPlusOffset(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::MCObjectStreamer::emitRelocDirective(), EmitSymbolRefWithOfs(), llvm::AsmPrinter::emitXRayTable(), llvm::CodeViewContext::encodeDefRange(), llvm::MipsMCCodeEmitter::getBranchTarget21OpValue(), llvm::MipsMCCodeEmitter::getBranchTarget21OpValueMM(), llvm::MipsMCCodeEmitter::getBranchTarget26OpValue(), llvm::MipsMCCodeEmitter::getBranchTarget26OpValueMM(), llvm::MipsMCCodeEmitter::getBranchTargetOpValue(), llvm::MipsMCCodeEmitter::getBranchTargetOpValue1SImm16(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueLsl2MMR6(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueMMR6(), llvm::MipsTargetObjectFile::getDebugThreadLocalSymbol(), llvm::SystemZMCInstLower::getExpr(), llvm::X86_64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::AArch64_ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::ARMElfTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::RISCVELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::X86_64ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), GetSymbolRef(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::AsmPrinter::lowerConstant(), llvm::AMDGPUMCInstLower::lowerOperand(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::TargetLoweringObjectFileELF::lowerSymbolDifference(), LowerSymbolOperand(), llvm::XtensaAsmPrinter::LowerSymbolOperand(), llvm::LanaiMCInstLower::LowerSymbolOperand(), llvm::M68kMCInstLower::LowerSymbolOperand(), llvm::MSP430MCInstLower::LowerSymbolOperand(), lowerSymbolOperand(), llvm::AVRMCInstLower::lowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandCOFF(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), llvm::AArch64MCInstLower::lowerSymbolOperandMachO(), llvm::LoongArchAsmBackend::relaxAlign(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), llvm::MCExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand().

◆ createAnd()

static const MCBinaryExpr * llvm::MCBinaryExpr::createAnd ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

◆ createAShr()

static const MCBinaryExpr * llvm::MCBinaryExpr::createAShr ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 418 of file MCExpr.h.

References AShr, create(), LHS, and RHS.

Referenced by llvm::SIInstrInfo::insertIndirectBranch().

◆ createDiv()

static const MCBinaryExpr * llvm::MCBinaryExpr::createDiv ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 353 of file MCExpr.h.

References create(), Div, LHS, and RHS.

Referenced by computeAccumOffset(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), and GetSubDivExpr().

◆ createEQ()

static const MCBinaryExpr * llvm::MCBinaryExpr::createEQ ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 358 of file MCExpr.h.

References create(), EQ, LHS, and RHS.

◆ createGT()

static const MCBinaryExpr * llvm::MCBinaryExpr::createGT ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 363 of file MCExpr.h.

References create(), GT, LHS, and RHS.

◆ createGTE()

static const MCBinaryExpr * llvm::MCBinaryExpr::createGTE ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 368 of file MCExpr.h.

References create(), GTE, LHS, and RHS.

◆ createLAnd()

static const MCBinaryExpr * llvm::MCBinaryExpr::createLAnd ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 373 of file MCExpr.h.

References create(), LAnd, LHS, and RHS.

◆ createLOr()

static const MCBinaryExpr * llvm::MCBinaryExpr::createLOr ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 378 of file MCExpr.h.

References create(), LHS, LOr, and RHS.

◆ createLShr()

static const MCBinaryExpr * llvm::MCBinaryExpr::createLShr ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

◆ createLT()

static const MCBinaryExpr * llvm::MCBinaryExpr::createLT ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 383 of file MCExpr.h.

References create(), LHS, LT, and RHS.

◆ createLTE()

static const MCBinaryExpr * llvm::MCBinaryExpr::createLTE ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 388 of file MCExpr.h.

References create(), LHS, LTE, and RHS.

◆ createMod()

static const MCBinaryExpr * llvm::MCBinaryExpr::createMod ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 393 of file MCExpr.h.

References create(), LHS, Mod, and RHS.

◆ createMul()

static const MCBinaryExpr * llvm::MCBinaryExpr::createMul ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

◆ createNE()

static const MCBinaryExpr * llvm::MCBinaryExpr::createNE ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 403 of file MCExpr.h.

References create(), LHS, NE, and RHS.

◆ createOr()

static const MCBinaryExpr * llvm::MCBinaryExpr::createOr ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

◆ createShl()

static const MCBinaryExpr * llvm::MCBinaryExpr::createShl ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 413 of file MCExpr.h.

References create(), LHS, RHS, and Shl.

Referenced by llvm::AMDGPU::MCKernelDescriptor::bits_set(), MaskShift(), and llvm::AMDGPU::maskShiftSet().

◆ createSub()

static const MCBinaryExpr * llvm::MCBinaryExpr::createSub ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 428 of file MCExpr.h.

References create(), LHS, RHS, and Sub.

Referenced by llvm::CSKYConstantPool::addEntry(), addNegOperand(), computeAccumOffset(), createPCXRelExprOp(), llvm::SystemZTargetGOFFStreamer::createWordDiffExpr(), llvm::SystemZTargetHLASMStreamer::createWordDiffExpr(), EmitAbsDifference(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::emitAbsoluteSymbolDiffAsULEB128(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::EHStreamer::emitExceptionTable(), llvm::AsmPrinter::emitFunctionBody(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata(), llvm::ARMAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::AMDGPUTargetELFStreamer::EmitISAVersion(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::AsmPrinter::emitJumpTableEntry(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::X86AsmPrinter::emitKCFITypeId(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), EmitSymbolRefWithOfs(), llvm::AsmPrinter::emitXRayTable(), llvm::WasmException::endFunction(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), GetOptionalAbsDifference(), GetSubDivExpr(), GetSymbolRef(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::AsmPrinter::lowerConstant(), llvm::VETargetLowering::LowerCustomJumpTableEntry(), llvm::TargetLoweringObjectFileELF::lowerSymbolDifference(), llvm::FaultMaps::recordFaultingOp(), llvm::MCExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand().

◆ createXor()

static const MCBinaryExpr * llvm::MCBinaryExpr::createXor ( const MCExpr LHS,
const MCExpr RHS,
MCContext Ctx 
)
inlinestatic

Definition at line 433 of file MCExpr.h.

References create(), LHS, RHS, and Xor.

◆ getLHS()

const MCExpr * llvm::MCBinaryExpr::getLHS ( ) const
inline

◆ getOpcode()

Opcode llvm::MCBinaryExpr::getOpcode ( ) const
inline

◆ getRHS()

const MCExpr * llvm::MCBinaryExpr::getRHS ( ) const
inline

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