LLVM  8.0.1
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:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCBinaryExpr:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

Accessors
Opcode getOpcode () const
 Get the kind of this binary expression. More...
 
const MCExprgetLHS () const
 Get the left-hand side expression of the binary operator. More...
 
const MCExprgetRHS () const
 Get the right-hand side expression of the binary operator. More...
 
- Public Member Functions inherited from llvm::MCExpr
 MCExpr (const MCExpr &)=delete
 
MCExproperator= (const MCExpr &)=delete
 
ExprKind getKind () const
 
SMLoc getLoc () const
 
void print (raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
 
void dump () const
 
bool evaluateAsAbsolute (int64_t &Res, const MCAsmLayout &Layout, const SectionAddrMap &Addrs) const
 Try to evaluate the expression to an absolute value. More...
 
bool evaluateAsAbsolute (int64_t &Res) const
 
bool evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const
 
bool evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const
 
bool evaluateAsAbsolute (int64_t &Res, const MCAsmLayout &Layout) const
 
bool evaluateKnownAbsolute (int64_t &Res, const MCAsmLayout &Layout) const
 
bool evaluateAsRelocatable (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
 Try to evaluate the expression to a relocatable value, i.e. More...
 
bool evaluateAsValue (MCValue &Res, const MCAsmLayout &Layout) const
 Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables. More...
 
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. More...
 

Static Public Member Functions

static bool classof (const MCExpr *E)
 
Construction
static 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)
 
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)
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::MCExpr
 MCExpr (ExprKind Kind, SMLoc Loc)
 
bool evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const
 

Detailed Description

Binary assembler expressions.

Definition at line 417 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.

Shl 

Shift left.

AShr 

Arithmetic shift right.

LShr 

Logical shift right.

Sub 

Subtraction.

Xor 

Bitwise exclusive or.

Definition at line 419 of file MCExpr.h.

Member Function Documentation

◆ classof()

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

Definition at line 571 of file MCExpr.h.

References llvm::MCExpr::Binary, and llvm::MCExpr::getKind().

◆ create()

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

Definition at line 153 of file MCExpr.cpp.

Referenced by addNegOperand(), buildSymbolDiff(), getGNUBinOpPrecedence(), and RefineErrorLoc().

◆ createAdd()

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

Definition at line 461 of file MCExpr.h.

References llvm::MCID::Add.

Referenced by llvm::ARCMCInstLower::ARCMCInstLower(), ConvertDoubleToBytes(), llvm::MCWinCOFFStreamer::EmitCOFFImgRel32(), llvm::MCWinCOFFStreamer::EmitCOFFSecRel32(), llvm::SystemZAsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitInstruction(), llvm::X86AsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitJumpTableAddrs(), llvm::ARMAsmPrinter::EmitJumpTableTBInst(), llvm::AsmPrinter::EmitLabelPlusOffset(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), EmitSymbolRefWithOfs(), llvm::CodeViewContext::encodeDefRange(), llvm::WinException::endFunclet(), 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::X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), getRealVLDOpcode(), GetSymbolRef(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), getVariantKind(), HasSecRelSymbolRef(), llvm::XCoreMCInstLower::Initialize(), llvm::MipsMCInstLower::Initialize(), isPCRel(), llvm::AsmPrinter::lowerConstant(), lowerSymbolOperand(), llvm::AVRMCInstLower::lowerSymbolOperand(), llvm::MSP430MCInstLower::LowerSymbolOperand(), llvm::LanaiMCInstLower::LowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandCOFF(), llvm::AArch64MCInstLower::lowerSymbolOperandDarwin(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), printMCExpr(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::MCExternalSymbolizer::tryAddingSymbolicOperand().

◆ createAnd()

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

Definition at line 466 of file MCExpr.h.

Referenced by ConvertDoubleToBytes(), and llvm::AsmPrinter::lowerConstant().

◆ createAShr()

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

Definition at line 536 of file MCExpr.h.

◆ createDiv()

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

◆ createEQ()

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

Definition at line 476 of file MCExpr.h.

References EQ.

◆ createGT()

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

Definition at line 481 of file MCExpr.h.

References llvm::AArch64CC::GT.

◆ createGTE()

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

Definition at line 486 of file MCExpr.h.

◆ createLAnd()

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

Definition at line 491 of file MCExpr.h.

◆ createLOr()

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

Definition at line 496 of file MCExpr.h.

◆ createLShr()

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

Definition at line 541 of file MCExpr.h.

◆ createLT()

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

Definition at line 501 of file MCExpr.h.

References llvm::AArch64CC::LT.

◆ createLTE()

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

Definition at line 506 of file MCExpr.h.

◆ createMod()

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

Definition at line 511 of file MCExpr.h.

References llvm::Mod.

Referenced by llvm::AsmPrinter::lowerConstant().

◆ createMul()

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

Definition at line 516 of file MCExpr.h.

Referenced by llvm::AsmPrinter::lowerConstant().

◆ createNE()

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

Definition at line 521 of file MCExpr.h.

References llvm::AArch64CC::NE.

◆ createOr()

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

Definition at line 526 of file MCExpr.h.

Referenced by llvm::AsmPrinter::lowerConstant().

◆ createShl()

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

Definition at line 531 of file MCExpr.h.

Referenced by llvm::AsmPrinter::lowerConstant().

◆ createSub()

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

Definition at line 546 of file MCExpr.h.

Referenced by addNegOperand(), EmitAbsDifference(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::emitAbsoluteSymbolDiffAsULEB128(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::AsmPrinter::EmitFunctionBody(), llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata(), llvm::ARMAsmPrinter::EmitInstruction(), llvm::X86AsmPrinter::EmitInstruction(), llvm::AMDGPUTargetELFStreamer::EmitISAVersion(), llvm::ARMAsmPrinter::EmitJumpTableAddrs(), llvm::AsmPrinter::EmitJumpTableInfo(), llvm::ARMAsmPrinter::EmitJumpTableTBInst(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), EmitSymbolRefWithOfs(), llvm::WinException::endFunclet(), llvm::WasmException::endFunction(), GetAbsDifference(), getDwarfRegNum(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), GetSymbolRef(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), getVariantKind(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), llvm::AsmPrinter::lowerConstant(), llvm::MipsMCInstLower::LowerOperand(), llvm::TargetLoweringObjectFileELF::lowerRelativeReference(), llvm::TargetLoweringObjectFileWasm::lowerRelativeReference(), makeCombineInst(), llvm::FaultMaps::recordFaultingOp(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::MCExternalSymbolizer::tryAddingSymbolicOperand().

◆ createXor()

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

Definition at line 551 of file MCExpr.h.

Referenced by llvm::AsmPrinter::lowerConstant().

◆ 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: