1 //===-- SparcTargetStreamer.cpp - Sparc Target Streamer Methods -----------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file provides Sparc specific target streamer methods.
11 //===----------------------------------------------------------------------===//
13 #include "SparcTargetStreamer.h"
14 #include "SparcInstPrinter.h"
15 #include "llvm/Support/FormattedStream.h"
19 // pin vtable to this file
20 SparcTargetStreamer::SparcTargetStreamer(MCStreamer
&S
) : MCTargetStreamer(S
) {}
22 void SparcTargetStreamer::anchor() {}
24 SparcTargetAsmStreamer::SparcTargetAsmStreamer(MCStreamer
&S
,
25 formatted_raw_ostream
&OS
)
26 : SparcTargetStreamer(S
), OS(OS
) {}
28 void SparcTargetAsmStreamer::emitSparcRegisterIgnore(unsigned reg
) {
30 << "%" << StringRef(SparcInstPrinter::getRegisterName(reg
)).lower()
34 void SparcTargetAsmStreamer::emitSparcRegisterScratch(unsigned reg
) {
36 << "%" << StringRef(SparcInstPrinter::getRegisterName(reg
)).lower()
40 SparcTargetELFStreamer::SparcTargetELFStreamer(MCStreamer
&S
)
41 : SparcTargetStreamer(S
) {}
43 MCELFStreamer
&SparcTargetELFStreamer::getStreamer() {
44 return static_cast<MCELFStreamer
&>(Streamer
);