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 17 namespace llvm { 18 class LoongArchTargetStreamer : public MCTargetStreamer { 19 LoongArchABI::ABI TargetABI = LoongArchABI::ABI_Unknown; 20 21 public: 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 }; 31 32 // This part is for ascii assembly output. 33 class LoongArchTargetAsmStreamer : public LoongArchTargetStreamer { 34 formatted_raw_ostream &OS; 35 36 public: 37 LoongArchTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS); 38 39 void emitDirectiveOptionPush() override; 40 void emitDirectiveOptionPop() override; 41 void emitDirectiveOptionRelax() override; 42 void emitDirectiveOptionNoRelax() override; 43 }; 44 45 } // end namespace llvm 46 #endif 47