xref: /freebsd/contrib/llvm-project/llvm/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.h (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
10b57cec5SDimitry Andric //===-- SparcTargetStreamer.h - Sparc Target Streamer ----------*- C++ -*--===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCTARGETSTREAMER_H
100b57cec5SDimitry Andric #define LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCTARGETSTREAMER_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "llvm/MC/MCELFStreamer.h"
130b57cec5SDimitry Andric #include "llvm/MC/MCStreamer.h"
140b57cec5SDimitry Andric 
150b57cec5SDimitry Andric namespace llvm {
16fe6060f1SDimitry Andric 
17fe6060f1SDimitry Andric class formatted_raw_ostream;
18fe6060f1SDimitry Andric 
190b57cec5SDimitry Andric class SparcTargetStreamer : public MCTargetStreamer {
200b57cec5SDimitry Andric   virtual void anchor();
210b57cec5SDimitry Andric 
220b57cec5SDimitry Andric public:
230b57cec5SDimitry Andric   SparcTargetStreamer(MCStreamer &S);
240b57cec5SDimitry Andric   /// Emit ".register <reg>, #ignore".
emitSparcRegisterIgnore(unsigned reg)25*bdd1243dSDimitry Andric   virtual void emitSparcRegisterIgnore(unsigned reg){};
260b57cec5SDimitry Andric   /// Emit ".register <reg>, #scratch".
emitSparcRegisterScratch(unsigned reg)27*bdd1243dSDimitry Andric   virtual void emitSparcRegisterScratch(unsigned reg){};
280b57cec5SDimitry Andric };
290b57cec5SDimitry Andric 
300b57cec5SDimitry Andric // This part is for ascii assembly output
310b57cec5SDimitry Andric class SparcTargetAsmStreamer : public SparcTargetStreamer {
320b57cec5SDimitry Andric   formatted_raw_ostream &OS;
330b57cec5SDimitry Andric 
340b57cec5SDimitry Andric public:
350b57cec5SDimitry Andric   SparcTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
360b57cec5SDimitry Andric   void emitSparcRegisterIgnore(unsigned reg) override;
370b57cec5SDimitry Andric   void emitSparcRegisterScratch(unsigned reg) override;
380b57cec5SDimitry Andric };
390b57cec5SDimitry Andric 
400b57cec5SDimitry Andric // This part is for ELF object output
410b57cec5SDimitry Andric class SparcTargetELFStreamer : public SparcTargetStreamer {
420b57cec5SDimitry Andric public:
430b57cec5SDimitry Andric   SparcTargetELFStreamer(MCStreamer &S);
440b57cec5SDimitry Andric   MCELFStreamer &getStreamer();
emitSparcRegisterIgnore(unsigned reg)450b57cec5SDimitry Andric   void emitSparcRegisterIgnore(unsigned reg) override {}
emitSparcRegisterScratch(unsigned reg)460b57cec5SDimitry Andric   void emitSparcRegisterScratch(unsigned reg) override {}
470b57cec5SDimitry Andric };
480b57cec5SDimitry Andric } // end namespace llvm
490b57cec5SDimitry Andric 
500b57cec5SDimitry Andric #endif
51