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 
Create(MCExpr const * Expr,MCContext & Ctx)20 HexagonNoExtendOperand *HexagonNoExtendOperand::Create(MCExpr const *Expr,
21                                                        MCContext &Ctx) {
22   return new (Ctx) HexagonNoExtendOperand(Expr);
23 }
24 
evaluateAsRelocatableImpl(MCValue & Res,MCAsmLayout const * Layout,MCFixup const * Fixup) const25 bool HexagonNoExtendOperand::evaluateAsRelocatableImpl(
26     MCValue &Res, MCAsmLayout const *Layout, MCFixup const *Fixup) const {
27   return Expr->evaluateAsRelocatable(Res, Layout, Fixup);
28 }
29 
visitUsedExpr(MCStreamer & Streamer) const30 void HexagonNoExtendOperand::visitUsedExpr(MCStreamer &Streamer) const {}
31 
findAssociatedFragment() const32 MCFragment *llvm::HexagonNoExtendOperand::findAssociatedFragment() const {
33   return Expr->findAssociatedFragment();
34 }
35 
fixELFSymbolsInTLSFixups(MCAssembler & Asm) const36 void HexagonNoExtendOperand::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const {}
37 
getExpr() const38 MCExpr const *HexagonNoExtendOperand::getExpr() const { return Expr; }
39 
classof(MCExpr const * E)40 bool HexagonNoExtendOperand::classof(MCExpr const *E) {
41   return E->getKind() == MCExpr::Target;
42 }
43 
HexagonNoExtendOperand(MCExpr const * Expr)44 HexagonNoExtendOperand::HexagonNoExtendOperand(MCExpr const *Expr)
45     : Expr(Expr) {}
46 
printImpl(raw_ostream & OS,const MCAsmInfo * MAI) const47 void HexagonNoExtendOperand::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
48   Expr->print(OS, MAI);
49 }
50