19 #define DEBUG_TYPE "ppcmcexpr" 24 return new (Ctx)
PPCMCExpr(Kind, Expr, isDarwin);
72 PPCMCExpr::evaluateAsInt64(int64_t
Value)
const {
75 return Value & 0xffff;
77 return (Value >> 16) & 0xffff;
79 return ((Value + 0x8000) >> 16) & 0xffff;
81 return (Value >> 16) & 0xffff;
83 return ((Value + 0x8000) >> 16) & 0xffff;
85 return (Value >> 32) & 0xffff;
87 return ((Value + 0x8000) >> 32) & 0xffff;
89 return (Value >> 48) & 0xffff;
91 return ((Value + 0x8000) >> 48) & 0xffff;
108 int64_t Result = evaluateAsInt64(Value.
getConstant());
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
This represents an "assembler immediate".
VariantKind getKind() const
static const PPCMCExpr * create(VariantKind Kind, const MCExpr *Expr, bool isDarwin, MCContext &Ctx)
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
MCContext & getContext() const
A 16-bit fixup corresponding to lo16(_foo) or ha16(_foo) for instrs like 'li' or 'addis'.
int64_t getConstant() const
const MCSymbolRefExpr * getSymB() const
Encapsulates the layout of an assembly file at a particular point in time.
Base class for the full range of assembler expressions which are needed for parsing.
Represent a reference to a symbol from inside an expression.
Context object for machine code objects.
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
MCAssembler & getAssembler() const
Get the assembler object this is a layout for.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Streaming machine code generation interface.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
static bool isDarwin(object::Archive::Kind Kind)
const MCSymbolRefExpr * getSymA() const
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const MCSymbol & getSymbol() const
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
bool evaluateAsConstant(int64_t &Res) const
void visitUsedExpr(const MCExpr &Expr)
bool isDarwinSyntax() const
isDarwinSyntax - True if expression is to be printed using Darwin syntax.
static MCValue get(const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0)
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
void visitUsedExpr(MCStreamer &Streamer) const override
MCFixupKind getKind() const