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