xref: /aosp_15_r20/external/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //==- HexagonMCExpr.h - Hexagon specific MC expression classes --*- C++ -*-===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker 
10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONMCEXPR_H
11*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_HEXAGON_HEXAGONMCEXPR_H
12*9880d681SAndroid Build Coastguard Worker 
13*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCExpr.h"
14*9880d681SAndroid Build Coastguard Worker 
15*9880d681SAndroid Build Coastguard Worker namespace llvm {
16*9880d681SAndroid Build Coastguard Worker class MCInst;
17*9880d681SAndroid Build Coastguard Worker class HexagonMCExpr : public MCTargetExpr {
18*9880d681SAndroid Build Coastguard Worker public:
19*9880d681SAndroid Build Coastguard Worker   static HexagonMCExpr *create(MCExpr const *Expr, MCContext &Ctx);
20*9880d681SAndroid Build Coastguard Worker   void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
21*9880d681SAndroid Build Coastguard Worker   bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout,
22*9880d681SAndroid Build Coastguard Worker                                  const MCFixup *Fixup) const override;
23*9880d681SAndroid Build Coastguard Worker   void visitUsedExpr(MCStreamer &Streamer) const override;
24*9880d681SAndroid Build Coastguard Worker   MCFragment *findAssociatedFragment() const override;
25*9880d681SAndroid Build Coastguard Worker   void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
26*9880d681SAndroid Build Coastguard Worker   static bool classof(MCExpr const *E);
27*9880d681SAndroid Build Coastguard Worker   MCExpr const *getExpr() const;
28*9880d681SAndroid Build Coastguard Worker   void setMustExtend(bool Val = true);
29*9880d681SAndroid Build Coastguard Worker   bool mustExtend() const;
30*9880d681SAndroid Build Coastguard Worker   void setMustNotExtend(bool Val = true);
31*9880d681SAndroid Build Coastguard Worker   bool mustNotExtend() const;
32*9880d681SAndroid Build Coastguard Worker   void setS23_2_reloc(bool Val = true);
33*9880d681SAndroid Build Coastguard Worker   bool s23_2_reloc() const;
34*9880d681SAndroid Build Coastguard Worker   void setSignMismatch(bool Val = true);
35*9880d681SAndroid Build Coastguard Worker   bool signMismatch() const;
36*9880d681SAndroid Build Coastguard Worker 
37*9880d681SAndroid Build Coastguard Worker private:
38*9880d681SAndroid Build Coastguard Worker   HexagonMCExpr(MCExpr const *Expr);
39*9880d681SAndroid Build Coastguard Worker   MCExpr const *Expr;
40*9880d681SAndroid Build Coastguard Worker   bool MustNotExtend;
41*9880d681SAndroid Build Coastguard Worker   bool MustExtend;
42*9880d681SAndroid Build Coastguard Worker   bool S23_2_reloc;
43*9880d681SAndroid Build Coastguard Worker   bool SignMismatch;
44*9880d681SAndroid Build Coastguard Worker };
45*9880d681SAndroid Build Coastguard Worker } // end namespace llvm
46*9880d681SAndroid Build Coastguard Worker 
47*9880d681SAndroid Build Coastguard Worker #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONMCEXPR_H
48