1 //===-- ARMMCExpr.cpp - ARM specific MC expression classes ----------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "ARMMCExpr.h"
11 #include "llvm/MC/MCContext.h"
12 #include "llvm/MC/MCStreamer.h"
15 #define DEBUG_TYPE "armmcexpr"
18 ARMMCExpr::create(VariantKind Kind, const MCExpr *Expr,
20 return new (Ctx) ARMMCExpr(Kind, Expr);
23 void ARMMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
25 default: llvm_unreachable("Invalid kind!");
26 case VK_ARM_HI16: OS << ":upper16:"; break;
27 case VK_ARM_LO16: OS << ":lower16:"; break;
30 const MCExpr *Expr = getSubExpr();
31 if (Expr->getKind() != MCExpr::SymbolRef)
34 if (Expr->getKind() != MCExpr::SymbolRef)
38 void ARMMCExpr::visitUsedExpr(MCStreamer &Streamer) const {
39 Streamer.visitUsedExpr(*getSubExpr());