32 auto &E =
static_cast<const AVRMCExpr &
>(Expr);
34 OS << E.getName() <<
'(';
44 auto &E =
static_cast<const AVRMCExpr &
>(Expr);
46 bool isRelocatable = E.getSubExpr()->evaluateAsRelocatable(
Value, Asm);
50 if (
Value.isAbsolute()) {
53 if (!Asm || !Asm->hasLayout())
57 if (
Value.getSpecifier())
73const struct ModifierEntry {
91 const auto &Modifier =
93 return Mod.Spelling == Name;
96 if (Modifier != std::end(ModifierNames)) {
97 return Modifier->specifier;
103 const auto &Modifier =
108 if (Modifier != std::end(ModifierNames)) {
109 return Modifier->Spelling;
158int64_t AVRMCExpr::evaluateAsInt64(int64_t
Value)
const {
212 if (
Value.isAbsolute()) {
213 Result = evaluateAsInt64(
Value.getConstant());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AVRMCAsmInfo(const Triple &TT, const MCTargetOptions &Options)
A expression in AVR machine code.
bool evaluateAsConstant(int64_t &Result) const
Evaluates the fixup as a constant value.
const char * getName() const
Gets the name of the expression.
static Specifier parseSpecifier(StringRef Name)
AVR::Fixups getFixupKind() const
Gets the fixup which corresponds to the expression.
MCAsmInfoELF(const Triple &TT, const MCTargetOptions &Options)
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool(* SpecifierExprEvaluateFn)(const MCSpecifierExpr &E, MCValue &Res, const MCAssembler *Asm)
void printExpr(raw_ostream &, const MCExpr &) const
bool SupportsDebugInformation
True if target supports emission of debugging information.
void(* SpecifierExprPrintFn)(const MCAsmInfo &, raw_ostream &, const MCSpecifierExpr &)
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line.
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
StringRef CommentString
This indicates the comment string used by the assembler.
LLVM_ABI bool evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm) const
Try to evaluate the expression to a relocatable value, i.e.
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
const MCExpr * getSubExpr() const
Spec getSpecifier() const
static MCValue get(const MCSymbol *SymA, const MCSymbol *SymB=nullptr, int64_t Val=0, uint32_t Specifier=0)
Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Fixups
The set of supported fixups.
@ fixup_16_pm
A 16-bit program memory address.
@ fixup_hh8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 24-bit value ...
@ fixup_ms8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 32-bi...
@ fixup_lo8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a negated 16-bi...
@ fixup_ms8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 32-bit value ...
@ fixup_lo8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a 16-bit value ...
@ fixup_hi8_ldi_pm_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 16-bi...
@ fixup_hi8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 16-bit value ...
@ fixup_lo8_ldi_pm
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a 16-bit progra...
@ fixup_hh8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 24-bi...
@ fixup_hh8_ldi_pm
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 24-bit progra...
@ fixup_lo8_ldi_pm_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a negated 16-bi...
@ fixup_hi8_ldi_pm
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 16-bit progra...
@ fixup_hh8_ldi_pm_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 24-bi...
@ fixup_hi8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 16-bi...
@ S_LO8
Corresponds to lo8().
@ S_LO8_GS
Corresponds to lo8(gs()).
@ S_HH8
Corresponds to hlo8() and hh8().
@ S_PM_HH8
Corresponds to pm_hh8().
@ S_HHI8
Corresponds to hhi8().
@ S_PM_LO8
Corresponds to pm_lo8().
@ S_PM
Corresponds to pm(), reference to program memory.
@ S_GS
Corresponds to gs().
@ S_HI8_GS
Corresponds to hi8(gs()).
@ S_PM_HI8
Corresponds to pm_hi8().
@ S_HI8
Corresponds to hi8().
This is an optimization pass for GlobalISel generic memory operations.
@ Mod
The access may modify the value stored in memory.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.