LLVM 23.0.0git
LoongArchTargetStreamer.cpp
Go to the documentation of this file.
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
14#include "llvm/MC/MCAsmInfo.h"
15#include "llvm/MC/MCContext.h"
16
17using namespace llvm;
18
21
24 "Improperly initialized target ABI");
25 TargetABI = ABI;
26}
27
34
35// This part is for ascii assembly output.
39
41 OS << "\t.option\tpush\n";
42}
43
45 OS << "\t.option\tpop\n";
46}
47
49 OS << "\t.option\trelax\n";
50}
51
53 OS << "\t.option\tnorelax\n";
54}
55
57 auto &MAI = getStreamer().getContext().getAsmInfo();
58 OS << "\t.dtprelword\t";
59 MAI.printExpr(OS, *Value);
60 OS << '\n';
61}
62
64 auto &MAI = getStreamer().getContext().getAsmInfo();
65 OS << "\t.dtpreldword\t";
66 MAI.printExpr(OS, *Value);
67 OS << '\n';
68}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
void emitDTPRel64Value(const MCExpr *) override
void emitDTPRel32Value(const MCExpr *) override
LoongArchTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
void setTargetABI(LoongArchABI::ABI ABI)
virtual void emitDTPRel64Value(const MCExpr *)
virtual void emitDTPRel32Value(const MCExpr *)
void printExpr(raw_ostream &, const MCExpr &) const
const MCAsmInfo & getAsmInfo() const
Definition MCContext.h:409
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:34
Streaming machine code generation interface.
Definition MCStreamer.h:222
MCContext & getContext() const
Definition MCStreamer.h:323
MCStreamer & getStreamer()
Definition MCStreamer.h:103
MCTargetStreamer(MCStreamer &S)
LLVM Value Representation.
Definition Value.h:75
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
This is an optimization pass for GlobalISel generic memory operations.