1 //===-- SparcTargetStreamer.h - Sparc Target Streamer ----------*- C++ -*--===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_LIB_TARGET_SPARC_SPARCTARGETSTREAMER_H
11 #define LLVM_LIB_TARGET_SPARC_SPARCTARGETSTREAMER_H
12 
13 #include "llvm/MC/MCELFStreamer.h"
14 #include "llvm/MC/MCStreamer.h"
15 
16 namespace llvm {
17 class SparcTargetStreamer : public MCTargetStreamer {
18   virtual void anchor();
19 
20 public:
21   SparcTargetStreamer(MCStreamer &S);
22   /// Emit ".register <reg>, #ignore".
23   virtual void emitSparcRegisterIgnore(unsigned reg) = 0;
24   /// Emit ".register <reg>, #scratch".
25   virtual void emitSparcRegisterScratch(unsigned reg) = 0;
26 };
27 
28 // This part is for ascii assembly output
29 class SparcTargetAsmStreamer : public SparcTargetStreamer {
30   formatted_raw_ostream &OS;
31 
32 public:
33   SparcTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
34   void emitSparcRegisterIgnore(unsigned reg) override;
35   void emitSparcRegisterScratch(unsigned reg) override;
36 
37 };
38 
39 // This part is for ELF object output
40 class SparcTargetELFStreamer : public SparcTargetStreamer {
41 public:
42   SparcTargetELFStreamer(MCStreamer &S);
43   MCELFStreamer &getStreamer();
emitSparcRegisterIgnore(unsigned reg)44   void emitSparcRegisterIgnore(unsigned reg) override {}
emitSparcRegisterScratch(unsigned reg)45   void emitSparcRegisterScratch(unsigned reg) override {}
46 };
47 } // end namespace llvm
48 
49 #endif
50