32const struct ModifierEntry {
50 const auto &Modifier =
55 if (Modifier != std::end(ModifierNames)) {
56 return Modifier->specifier;
62 const auto &Modifier =
67 if (Modifier != std::end(ModifierNames)) {
68 return Modifier->Spelling;
119 auto &E =
static_cast<const AVRMCExpr &
>(Expr);
121 OS << E.getName() <<
'(';
130int64_t AVRMCExpr::evaluateAsInt64(int64_t
Value)
const {
183 auto &E =
static_cast<const AVRMCExpr &
>(Expr);
185 bool isRelocatable = E.getSubExpr()->evaluateAsRelocatable(
Value, Asm);
189 if (
Value.isAbsolute()) {
192 if (!Asm || !Asm->hasLayout())
196 if (
Value.getSpecifier())
216 if (
Value.isAbsolute()) {
217 Result = evaluateAsInt64(
Value.getConstant());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AVRMCAsmInfo(const Triple &TT, const MCTargetOptions &Options)
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
bool evaluateAsRelocatableImpl(const MCSpecifierExpr &Expr, MCValue &Res, const MCAssembler *Asm) const override
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.
void printExpr(raw_ostream &, const MCExpr &) const
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
bool SupportsDebugInformation
True if target supports emission of debugging information.
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)
StringRef - 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.
@ 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().
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...
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.