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 RISCVTargetStreamer(MCStreamer & S)18RISCVTargetStreamer::RISCVTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {} 19 20 // This part is for ascii assembly output RISCVTargetAsmStreamer(MCStreamer & S,formatted_raw_ostream & OS)21RISCVTargetAsmStreamer::RISCVTargetAsmStreamer(MCStreamer &S, 22 formatted_raw_ostream &OS) 23 : RISCVTargetStreamer(S), OS(OS) {} 24 emitDirectiveOptionPush()25void RISCVTargetAsmStreamer::emitDirectiveOptionPush() { 26 OS << "\t.option\tpush\n"; 27 } 28 emitDirectiveOptionPop()29void RISCVTargetAsmStreamer::emitDirectiveOptionPop() { 30 OS << "\t.option\tpop\n"; 31 } 32 emitDirectiveOptionRVC()33void RISCVTargetAsmStreamer::emitDirectiveOptionRVC() { 34 OS << "\t.option\trvc\n"; 35 } 36 emitDirectiveOptionNoRVC()37void RISCVTargetAsmStreamer::emitDirectiveOptionNoRVC() { 38 OS << "\t.option\tnorvc\n"; 39 } 40 emitDirectiveOptionRelax()41void RISCVTargetAsmStreamer::emitDirectiveOptionRelax() { 42 OS << "\t.option\trelax\n"; 43 } 44 emitDirectiveOptionNoRelax()45void RISCVTargetAsmStreamer::emitDirectiveOptionNoRelax() { 46 OS << "\t.option\tnorelax\n"; 47 } 48