| 1 | //===-- LoongArchTargetStreamer.cpp - LoongArch 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 LoongArch specific target streamer methods. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include "LoongArchTargetStreamer.h" |
| 14 | |
| 15 | using namespace llvm; |
| 16 | |
| 17 | LoongArchTargetStreamer::LoongArchTargetStreamer(MCStreamer &S) |
| 18 | : MCTargetStreamer(S) {} |
| 19 | |
| 20 | void LoongArchTargetStreamer::setTargetABI(LoongArchABI::ABI ABI) { |
| 21 | assert(ABI != LoongArchABI::ABI_Unknown && |
| 22 | "Improperly initialized target ABI"); |
| 23 | TargetABI = ABI; |
| 24 | } |
| 25 | |
| 26 | void LoongArchTargetStreamer::emitDirectiveOptionPush() {} |
| 27 | void LoongArchTargetStreamer::emitDirectiveOptionPop() {} |
| 28 | void LoongArchTargetStreamer::emitDirectiveOptionRelax() {} |
| 29 | void LoongArchTargetStreamer::emitDirectiveOptionNoRelax() {} |
| 30 | |
| 31 | // This part is for ascii assembly output. |
| 32 | LoongArchTargetAsmStreamer::LoongArchTargetAsmStreamer( |
| 33 | MCStreamer &S, formatted_raw_ostream &OS) |
| 34 | : LoongArchTargetStreamer(S), OS(OS) {} |
| 35 | |
| 36 | void LoongArchTargetAsmStreamer::emitDirectiveOptionPush() { |
| 37 | OS << "\t.option\tpush\n"; |
| 38 | } |
| 39 | |
| 40 | void LoongArchTargetAsmStreamer::emitDirectiveOptionPop() { |
| 41 | OS << "\t.option\tpop\n"; |
| 42 | } |
| 43 | |
| 44 | void LoongArchTargetAsmStreamer::emitDirectiveOptionRelax() { |
| 45 | OS << "\t.option\trelax\n"; |
| 46 | } |
| 47 | |
| 48 | void LoongArchTargetAsmStreamer::emitDirectiveOptionNoRelax() { |
| 49 | OS << "\t.option\tnorelax\n"; |
| 50 | } |
| 51 |