xref: /freebsd/contrib/llvm-project/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 //==- HexagonMCExpr.h - Hexagon specific MC expression classes --*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONMCEXPR_H
10 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONMCEXPR_H
11 
12 #include "llvm/MC/MCExpr.h"
13 
14 namespace llvm {
15 class HexagonMCExpr : public MCTargetExpr {
16 public:
17   static HexagonMCExpr *create(MCExpr const *Expr, MCContext &Ctx);
18   void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
19   bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
20                                  const MCFixup *Fixup) const override;
21   void visitUsedExpr(MCStreamer &Streamer) const override;
22   MCFragment *findAssociatedFragment() const override;
23   void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
24   MCExpr const *getExpr() const;
25   void setMustExtend(bool Val = true);
26   bool mustExtend() const;
27   void setMustNotExtend(bool Val = true);
28   bool mustNotExtend() const;
29   void setS27_2_reloc(bool Val = true);
30   bool s27_2_reloc() const;
31   void setSignMismatch(bool Val = true);
32   bool signMismatch() const;
33 
34 private:
35   HexagonMCExpr(MCExpr const *Expr);
36   MCExpr const *Expr;
37   bool MustNotExtend;
38   bool MustExtend;
39   bool S27_2_reloc;
40   bool SignMismatch;
41 };
42 } // end namespace llvm
43 
44 #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONMCEXPR_H
45