Shiva Chen | 056d835 | 2018-01-26 07:53:07 +0000 | [diff] [blame] | 1 | //===-- RISCVTargetStreamer.cpp - RISCV Target Streamer Methods -----------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file provides RISCV specific target streamer methods. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "RISCVTargetStreamer.h" |
Alex Bradbury | bca0c3c | 2018-05-11 17:30:28 +0000 | [diff] [blame] | 15 | #include "llvm/Support/FormattedStream.h" |
Shiva Chen | 056d835 | 2018-01-26 07:53:07 +0000 | [diff] [blame] | 16 | |
| 17 | using namespace llvm; |
| 18 | |
| 19 | RISCVTargetStreamer::RISCVTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {} |
Alex Bradbury | bca0c3c | 2018-05-11 17:30:28 +0000 | [diff] [blame] | 20 | |
| 21 | // This part is for ascii assembly output |
| 22 | RISCVTargetAsmStreamer::RISCVTargetAsmStreamer(MCStreamer &S, |
| 23 | formatted_raw_ostream &OS) |
| 24 | : RISCVTargetStreamer(S), OS(OS) {} |
| 25 | |
Alex Bradbury | 893e5bc | 2018-11-28 16:39:14 +0000 | [diff] [blame] | 26 | void RISCVTargetAsmStreamer::emitDirectiveOptionPush() { |
| 27 | OS << "\t.option\tpush\n"; |
| 28 | } |
| 29 | |
| 30 | void RISCVTargetAsmStreamer::emitDirectiveOptionPop() { |
| 31 | OS << "\t.option\tpop\n"; |
| 32 | } |
| 33 | |
Alex Bradbury | bca0c3c | 2018-05-11 17:30:28 +0000 | [diff] [blame] | 34 | void RISCVTargetAsmStreamer::emitDirectiveOptionRVC() { |
| 35 | OS << "\t.option\trvc\n"; |
| 36 | } |
| 37 | |
| 38 | void RISCVTargetAsmStreamer::emitDirectiveOptionNoRVC() { |
| 39 | OS << "\t.option\tnorvc\n"; |
| 40 | } |
Alex Bradbury | 9c03e4c | 2018-11-12 14:25:07 +0000 | [diff] [blame] | 41 | |
| 42 | void RISCVTargetAsmStreamer::emitDirectiveOptionRelax() { |
| 43 | OS << "\t.option\trelax\n"; |
| 44 | } |
| 45 | |
| 46 | void RISCVTargetAsmStreamer::emitDirectiveOptionNoRelax() { |
| 47 | OS << "\t.option\tnorelax\n"; |
| 48 | } |