]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / lib / Target / RISCV / MCTargetDesc / RISCVTargetStreamer.cpp
1 //===-- RISCVTargetStreamer.cpp - RISCV Target Streamer Methods -----------===//
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 // This file provides RISCV specific target streamer methods.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "RISCVTargetStreamer.h"
14 #include "llvm/Support/FormattedStream.h"
15
16 using namespace llvm;
17
18 RISCVTargetStreamer::RISCVTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
19
20 // This part is for ascii assembly output
21 RISCVTargetAsmStreamer::RISCVTargetAsmStreamer(MCStreamer &S,
22                                                formatted_raw_ostream &OS)
23     : RISCVTargetStreamer(S), OS(OS) {}
24
25 void RISCVTargetAsmStreamer::emitDirectiveOptionPush() {
26   OS << "\t.option\tpush\n";
27 }
28
29 void RISCVTargetAsmStreamer::emitDirectiveOptionPop() {
30   OS << "\t.option\tpop\n";
31 }
32
33 void RISCVTargetAsmStreamer::emitDirectiveOptionRVC() {
34   OS << "\t.option\trvc\n";
35 }
36
37 void RISCVTargetAsmStreamer::emitDirectiveOptionNoRVC() {
38   OS << "\t.option\tnorvc\n";
39 }
40
41 void RISCVTargetAsmStreamer::emitDirectiveOptionRelax() {
42   OS << "\t.option\trelax\n";
43 }
44
45 void RISCVTargetAsmStreamer::emitDirectiveOptionNoRelax() {
46   OS << "\t.option\tnorelax\n";
47 }