Home | History | Annotate | Download | only in MCTargetDesc
      1 //===-- HexagonMCExpr.cpp - Hexagon specific MC expression classes
      2 //----------===//
      3 //
      4 //                     The LLVM Compiler Infrastructure
      5 //
      6 // This file is distributed under the University of Illinois Open Source
      7 // License. See LICENSE.TXT for details.
      8 //
      9 //===----------------------------------------------------------------------===//
     10 
     11 #include "HexagonMCExpr.h"
     12 #include "llvm/MC/MCContext.h"
     13 #include "llvm/MC/MCValue.h"
     14 #include "llvm/Support/raw_ostream.h"
     15 
     16 using namespace llvm;
     17 
     18 #define DEBUG_TYPE "hexagon-mcexpr"
     19 
     20 HexagonNoExtendOperand *HexagonNoExtendOperand::Create(MCExpr const *Expr,
     21                                                        MCContext &Ctx) {
     22   return new (Ctx) HexagonNoExtendOperand(Expr);
     23 }
     24 
     25 bool HexagonNoExtendOperand::evaluateAsRelocatableImpl(
     26     MCValue &Res, MCAsmLayout const *Layout, MCFixup const *Fixup) const {
     27   return Expr->evaluateAsRelocatable(Res, Layout, Fixup);
     28 }
     29 
     30 void HexagonNoExtendOperand::visitUsedExpr(MCStreamer &Streamer) const {}
     31 
     32 MCFragment *llvm::HexagonNoExtendOperand::findAssociatedFragment() const {
     33   return Expr->findAssociatedFragment();
     34 }
     35 
     36 void HexagonNoExtendOperand::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const {}
     37 
     38 MCExpr const *HexagonNoExtendOperand::getExpr() const { return Expr; }
     39 
     40 bool HexagonNoExtendOperand::classof(MCExpr const *E) {
     41   return E->getKind() == MCExpr::Target;
     42 }
     43 
     44 HexagonNoExtendOperand::HexagonNoExtendOperand(MCExpr const *Expr)
     45     : Expr(Expr) {}
     46 
     47 void HexagonNoExtendOperand::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
     48   Expr->print(OS, MAI);
     49 }
     50