xref: /freebsd/contrib/llvm-project/llvm/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.h (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1 //===-- SparcTargetStreamer.h - Sparc 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_SPARC_MCTARGETDESC_SPARCTARGETSTREAMER_H
10 #define LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCTARGETSTREAMER_H
11 
12 #include "llvm/MC/MCELFStreamer.h"
13 #include "llvm/MC/MCStreamer.h"
14 
15 namespace llvm {
16 
17 class formatted_raw_ostream;
18 
19 class SparcTargetStreamer : public MCTargetStreamer {
20   virtual void anchor();
21 
22 public:
23   SparcTargetStreamer(MCStreamer &S);
24   /// Emit ".register <reg>, #ignore".
25   virtual void emitSparcRegisterIgnore(unsigned reg){};
26   /// Emit ".register <reg>, #scratch".
27   virtual void emitSparcRegisterScratch(unsigned reg){};
28 };
29 
30 // This part is for ascii assembly output
31 class SparcTargetAsmStreamer : public SparcTargetStreamer {
32   formatted_raw_ostream &OS;
33 
34 public:
35   SparcTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
36   void emitSparcRegisterIgnore(unsigned reg) override;
37   void emitSparcRegisterScratch(unsigned reg) override;
38 };
39 
40 // This part is for ELF object output
41 class SparcTargetELFStreamer : public SparcTargetStreamer {
42 public:
43   SparcTargetELFStreamer(MCStreamer &S);
44   MCELFStreamer &getStreamer();
45   void emitSparcRegisterIgnore(unsigned reg) override {}
46   void emitSparcRegisterScratch(unsigned reg) override {}
47 };
48 } // end namespace llvm
49 
50 #endif
51