| 1 | //==-- LoongArchELFStreamer.h - LoongArch ELF Target Streamer --*- 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_LOONGARCH_MCTARGETDESC_LOONGARCHELFSTREAMER_H |
| 10 | #define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHELFSTREAMER_H |
| 11 | |
| 12 | #include "LoongArchTargetStreamer.h" |
| 13 | #include "llvm/MC/MCELFStreamer.h" |
| 14 | |
| 15 | namespace llvm { |
| 16 | |
| 17 | class LoongArchTargetELFStreamer : public LoongArchTargetStreamer { |
| 18 | public: |
| 19 | MCELFStreamer &getStreamer(); |
| 20 | LoongArchTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI); |
| 21 | |
| 22 | void emitDirectiveOptionPush() override; |
| 23 | void emitDirectiveOptionPop() override; |
| 24 | void emitDirectiveOptionRelax() override; |
| 25 | void emitDirectiveOptionNoRelax() override; |
| 26 | void emitDTPRel32Value(const MCExpr *) override; |
| 27 | void emitDTPRel64Value(const MCExpr *) override; |
| 28 | |
| 29 | void finish() override; |
| 30 | }; |
| 31 | |
| 32 | class LoongArchELFStreamer : public MCELFStreamer { |
| 33 | public: |
| 34 | LoongArchELFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> MAB, |
| 35 | std::unique_ptr<MCObjectWriter> MOW, |
| 36 | std::unique_ptr<MCCodeEmitter> MCE) |
| 37 | : MCELFStreamer(C, std::move(MAB), std::move(MOW), std::move(MCE)) {} |
| 38 | |
| 39 | void emitCodeAlignment(Align Alignment, const MCSubtargetInfo &STI, |
| 40 | unsigned MaxBytesToEmit) override; |
| 41 | }; |
| 42 | |
| 43 | MCELFStreamer *createLoongArchELFStreamer(MCContext &C, |
| 44 | std::unique_ptr<MCAsmBackend> MAB, |
| 45 | std::unique_ptr<MCObjectWriter> MOW, |
| 46 | std::unique_ptr<MCCodeEmitter> MCE); |
| 47 | } // end namespace llvm |
| 48 | #endif |
| 49 | |