1//===-- LoongArchTargetStreamer.h - LoongArch 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_LOONGARCHTARGETSTREAMER_H
10#define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHTARGETSTREAMER_H
11
12#include "LoongArch.h"
13#include "llvm/MC/MCStreamer.h"
14#include "llvm/MC/MCSubtargetInfo.h"
15#include "llvm/Support/FormattedStream.h"
16
17namespace llvm {
18class LoongArchTargetStreamer : public MCTargetStreamer {
19 LoongArchABI::ABI TargetABI = LoongArchABI::ABI_Unknown;
20
21public:
22 LoongArchTargetStreamer(MCStreamer &S);
23 void setTargetABI(LoongArchABI::ABI ABI);
24 LoongArchABI::ABI getTargetABI() const { return TargetABI; }
25
26 virtual void emitDirectiveOptionPush();
27 virtual void emitDirectiveOptionPop();
28 virtual void emitDirectiveOptionRelax();
29 virtual void emitDirectiveOptionNoRelax();
30 virtual void emitDTPRel32Value(const MCExpr *);
31 virtual void emitDTPRel64Value(const MCExpr *);
32};
33
34// This part is for ascii assembly output.
35class LoongArchTargetAsmStreamer : public LoongArchTargetStreamer {
36 formatted_raw_ostream &OS;
37
38public:
39 LoongArchTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
40
41 void emitDirectiveOptionPush() override;
42 void emitDirectiveOptionPop() override;
43 void emitDirectiveOptionRelax() override;
44 void emitDirectiveOptionNoRelax() override;
45 void emitDTPRel32Value(const MCExpr *) override;
46 void emitDTPRel64Value(const MCExpr *) override;
47};
48
49} // end namespace llvm
50#endif
51