#ifndef LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCEXPR_H
#define LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCEXPR_H
#include "llvm/MC/MCExpr.h"
namespace llvm {
class ARMMCExpr : public MCTargetExpr {
public:
enum VariantKind {
VK_ARM_None,
VK_ARM_HI16, VK_ARM_LO16 };
private:
const VariantKind Kind;
const MCExpr *Expr;
explicit ARMMCExpr(VariantKind Kind, const MCExpr *Expr)
: Kind(Kind), Expr(Expr) {}
public:
static const ARMMCExpr *create(VariantKind Kind, const MCExpr *Expr,
MCContext &Ctx);
static const ARMMCExpr *createUpper16(const MCExpr *Expr, MCContext &Ctx) {
return create(VK_ARM_HI16, Expr, Ctx);
}
static const ARMMCExpr *createLower16(const MCExpr *Expr, MCContext &Ctx) {
return create(VK_ARM_LO16, Expr, Ctx);
}
VariantKind getKind() const { return Kind; }
const MCExpr *getSubExpr() const { return Expr; }
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
bool evaluateAsRelocatableImpl(MCValue &Res,
const MCAsmLayout *Layout,
const MCFixup *Fixup) const override {
return false;
}
void visitUsedExpr(MCStreamer &Streamer) const override;
MCFragment *findAssociatedFragment() const override {
return getSubExpr()->findAssociatedFragment();
}
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override {}
static bool classof(const MCExpr *E) {
return E->getKind() == MCExpr::Target;
}
};
}
#endif