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

A expression in AVR machine code. More...

#include "Target/AVR/MCTargetDesc/AVRMCExpr.h"

Inheritance diagram for llvm::AVRMCExpr:
Inheritance graph
[legend]

Public Types

enum  VariantKind {
  VK_AVR_None = 0 , VK_AVR_HI8 , VK_AVR_LO8 , VK_AVR_HH8 ,
  VK_AVR_HHI8 , VK_AVR_PM , VK_AVR_PM_LO8 , VK_AVR_PM_HI8 ,
  VK_AVR_PM_HH8 , VK_AVR_LO8_GS , VK_AVR_HI8_GS , VK_AVR_GS
}
 Specifies the type of an expression. More...
 
- Public Types inherited from llvm::MCExpr
enum  ExprKind : uint8_t {
  Binary , Constant , SymbolRef , Unary ,
  Target
}
 

Public Member Functions

VariantKind getKind () const
 Gets the type of the expression.
 
const chargetName () const
 Gets the name of the expression.
 
const MCExprgetSubExpr () const
 
AVR::Fixups getFixupKind () const
 Gets the fixup which corresponds to the expression.
 
bool evaluateAsConstant (int64_t &Result) const
 Evaluates the fixup as a constant value.
 
bool isNegated () const
 
void setNegated (bool negated=true)
 
void printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const override
 
bool evaluateAsRelocatableImpl (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
 
void visitUsedExpr (MCStreamer &streamer) const override
 
MCFragmentfindAssociatedFragment () const override
 
void fixELFSymbolsInTLSFixups (MCAssembler &Asm) const override
 
- Public Member Functions inherited from llvm::MCTargetExpr
virtual void printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const =0
 
virtual bool evaluateAsRelocatableImpl (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const =0
 
virtual bool isEqualTo (const MCExpr *x) const
 
virtual bool inlineAssignedExpr () const
 
virtual void visitUsedExpr (MCStreamer &Streamer) const =0
 
virtual MCFragmentfindAssociatedFragment () const =0
 
virtual void fixELFSymbolsInTLSFixups (MCAssembler &) const =0
 
- 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.
 
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.
 
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.
 
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 const AVRMCExprcreate (VariantKind Kind, const MCExpr *Expr, bool isNegated, MCContext &Ctx)
 Creates an AVR machine code expression.
 
static bool classof (const MCExpr *E)
 
static VariantKind getKindByName (StringRef Name)
 
- Static Public Member Functions inherited from llvm::MCTargetExpr
static bool classof (const MCExpr *E)
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::MCTargetExpr
 MCTargetExpr ()
 
virtual ~MCTargetExpr ()=default
 
- Protected Member Functions inherited from llvm::MCExpr
 MCExpr (ExprKind Kind, SMLoc Loc, unsigned SubclassData=0)
 
bool evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const
 
unsigned getSubclassData () const
 

Detailed Description

A expression in AVR machine code.

Definition at line 19 of file AVRMCExpr.h.

Member Enumeration Documentation

◆ VariantKind

Specifies the type of an expression.

Enumerator
VK_AVR_None 
VK_AVR_HI8 

Corresponds to hi8().

VK_AVR_LO8 

Corresponds to lo8().

VK_AVR_HH8 

Corresponds to hlo8() and hh8().

VK_AVR_HHI8 

Corresponds to hhi8().

VK_AVR_PM 

Corresponds to pm(), reference to program memory.

VK_AVR_PM_LO8 

Corresponds to pm_lo8().

VK_AVR_PM_HI8 

Corresponds to pm_hi8().

VK_AVR_PM_HH8 

Corresponds to pm_hh8().

VK_AVR_LO8_GS 

Corresponds to lo8(gs()).

VK_AVR_HI8_GS 

Corresponds to hi8(gs()).

VK_AVR_GS 

Corresponds to gs().

Definition at line 22 of file AVRMCExpr.h.

Member Function Documentation

◆ classof()

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

Definition at line 70 of file AVRMCExpr.h.

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

◆ create()

const AVRMCExpr * llvm::AVRMCExpr::create ( VariantKind  Kind,
const MCExpr Expr,
bool  isNegated,
MCContext Ctx 
)
static

Creates an AVR machine code expression.

Definition at line 38 of file AVRMCExpr.cpp.

Referenced by llvm::AVRAsmPrinter::lowerConstant(), and llvm::AVRMCInstLower::lowerSymbolOperand().

◆ evaluateAsConstant()

bool llvm::AVRMCExpr::evaluateAsConstant ( int64_t &  Result) const

Evaluates the fixup as a constant value.

Definition at line 54 of file AVRMCExpr.cpp.

References llvm::MCExpr::evaluateAsRelocatable(), and getSubExpr().

◆ evaluateAsRelocatableImpl()

bool llvm::AVRMCExpr::evaluateAsRelocatableImpl ( MCValue Res,
const MCAsmLayout Layout,
const MCFixup Fixup 
) const
overridevirtual

◆ findAssociatedFragment()

MCFragment * llvm::AVRMCExpr::findAssociatedFragment ( ) const
inlineoverridevirtual

Implements llvm::MCTargetExpr.

Definition at line 64 of file AVRMCExpr.h.

References llvm::MCExpr::findAssociatedFragment(), and getSubExpr().

◆ fixELFSymbolsInTLSFixups()

void llvm::AVRMCExpr::fixELFSymbolsInTLSFixups ( MCAssembler Asm) const
inlineoverridevirtual

Implements llvm::MCTargetExpr.

Definition at line 68 of file AVRMCExpr.h.

◆ getFixupKind()

AVR::Fixups llvm::AVRMCExpr::getFixupKind ( ) const

◆ getKind()

VariantKind llvm::AVRMCExpr::getKind ( ) const
inline

Gets the type of the expression.

Definition at line 46 of file AVRMCExpr.h.

Referenced by getFixupKind().

◆ getKindByName()

AVRMCExpr::VariantKind llvm::AVRMCExpr::getKindByName ( StringRef  Name)
static

Definition at line 209 of file AVRMCExpr.cpp.

References llvm::find_if(), llvm::Mod, Name, and VK_AVR_None.

◆ getName()

const char * llvm::AVRMCExpr::getName ( ) const

Gets the name of the expression.

Definition at line 197 of file AVRMCExpr.cpp.

References llvm::find_if(), and llvm::Mod.

Referenced by printImpl().

◆ getSubExpr()

const MCExpr * llvm::AVRMCExpr::getSubExpr ( ) const
inline

Definition at line 49 of file AVRMCExpr.h.

Referenced by evaluateAsConstant(), findAssociatedFragment(), printImpl(), and visitUsedExpr().

◆ isNegated()

bool llvm::AVRMCExpr::isNegated ( ) const
inline

Definition at line 55 of file AVRMCExpr.h.

Referenced by getFixupKind(), and printImpl().

◆ printImpl()

void llvm::AVRMCExpr::printImpl ( raw_ostream OS,
const MCAsmInfo MAI 
) const
overridevirtual

Implements llvm::MCTargetExpr.

Definition at line 43 of file AVRMCExpr.cpp.

References assert(), getName(), getSubExpr(), isNegated(), OS, llvm::MCExpr::print(), and VK_AVR_None.

◆ setNegated()

void llvm::AVRMCExpr::setNegated ( bool  negated = true)
inline

Definition at line 56 of file AVRMCExpr.h.

◆ visitUsedExpr()

void llvm::AVRMCExpr::visitUsedExpr ( MCStreamer streamer) const
overridevirtual

Implements llvm::MCTargetExpr.

Definition at line 193 of file AVRMCExpr.cpp.

References getSubExpr(), and llvm::MCStreamer::visitUsedExpr().


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