LLVM  5.0.0
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]
Collaboration diagram for llvm::MCBinaryExpr:
[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 MCExpr * getLHS () const
 Get the left-hand side expression of the binary operator. More...
 
const MCExpr * getRHS () const
 Get the right-hand side expression of the binary operator. More...
 
- Public Member Functions inherited from llvm::MCExpr
 MCExpr (const MCExpr &)=delete
 
MCExpr & operator= (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 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...
 
MCFragment * findAssociatedFragment () 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 MCBinaryExpr * create (Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
 
static const MCBinaryExpr * createAdd (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createAnd (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createDiv (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createEQ (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createGT (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createGTE (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createLAnd (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createLOr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createLT (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createLTE (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createMod (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createMul (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createNE (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createOr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createShl (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createAShr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createLShr (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createSub (const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
static const MCBinaryExpr * createXor (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 399 of file MCExpr.h.

Member Enumeration Documentation

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 401 of file MCExpr.h.

Member Function Documentation

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

Definition at line 553 of file MCExpr.h.

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

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

Definition at line 443 of file MCExpr.h.

References Add, and create().

Referenced by createPCXRelExprOp(), 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::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(), GetSymbolRef(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::AsmPrinter::lowerConstant(), llvm::AMDGPUMCInstLower::lowerOperand(), llvm::AVRMCInstLower::lowerSymbolOperand(), llvm::MSP430MCInstLower::LowerSymbolOperand(), llvm::LanaiMCInstLower::LowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandCOFF(), llvm::AArch64MCInstLower::lowerSymbolOperandDarwin(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::MCExternalSymbolizer::tryAddingSymbolicOperand().

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

Definition at line 448 of file MCExpr.h.

References And, and create().

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

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

Definition at line 518 of file MCExpr.h.

References AShr, and create().

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

Definition at line 453 of file MCExpr.h.

References create(), and Div.

Referenced by llvm::ARMAsmPrinter::EmitJumpTableTBInst(), and llvm::AsmPrinter::lowerConstant().

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

Definition at line 458 of file MCExpr.h.

References create(), and EQ.

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

Definition at line 463 of file MCExpr.h.

References create(), and GT.

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

Definition at line 468 of file MCExpr.h.

References create(), and GTE.

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

Definition at line 473 of file MCExpr.h.

References create(), and LAnd.

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

Definition at line 478 of file MCExpr.h.

References create(), and LOr.

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

Definition at line 523 of file MCExpr.h.

References create(), and LShr.

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

Definition at line 483 of file MCExpr.h.

References create(), and LT.

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

Definition at line 488 of file MCExpr.h.

References create(), and LTE.

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

Definition at line 493 of file MCExpr.h.

References create(), and Mod.

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

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

Definition at line 498 of file MCExpr.h.

References create(), and Mul.

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

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

Definition at line 503 of file MCExpr.h.

References create(), and NE.

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

Definition at line 508 of file MCExpr.h.

References create(), and Or.

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

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

Definition at line 513 of file MCExpr.h.

References create(), and Shl.

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

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

Definition at line 533 of file MCExpr.h.

References create(), and Xor.

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

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

Get the kind of this binary expression.

Definition at line 543 of file MCExpr.h.

Referenced by llvm::MCExpr::evaluateAsRelocatableImpl(), EvaluateCRExpr(), llvm::MCExpr::findAssociatedFragment(), and llvm::MCExpr::print().

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

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