1 //===- AArch64TargetStreamer.cpp - AArch64TargetStreamer class ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the AArch64TargetStreamer class.
12 //===----------------------------------------------------------------------===//
14 #include "AArch64TargetStreamer.h"
15 #include "llvm/MC/ConstantPools.h"
20 // AArch64TargetStreamer Implemenation
22 AArch64TargetStreamer::AArch64TargetStreamer(MCStreamer &S)
23 : MCTargetStreamer(S), ConstantPools(new AssemblerConstantPools()) {}
25 AArch64TargetStreamer::~AArch64TargetStreamer() = default;
27 // The constant pool handling is shared by all AArch64TargetStreamer
29 const MCExpr *AArch64TargetStreamer::addConstantPoolEntry(const MCExpr *Expr,
32 return ConstantPools->addEntry(Streamer, Expr, Size, Loc);
35 void AArch64TargetStreamer::emitCurrentConstantPool() {
36 ConstantPools->emitForCurrentSection(Streamer);
39 // finish() - write out any non-empty assembler constant pools.
40 void AArch64TargetStreamer::finish() { ConstantPools->emitAll(Streamer); }
42 void AArch64TargetStreamer::emitInst(uint32_t Inst) {
45 // We can't just use EmitIntValue here, as that will swap the
46 // endianness on big-endian systems (instructions are always
48 for (unsigned I = 0; I < 4; ++I) {
49 Buffer[I] = uint8_t(Inst);
53 getStreamer().EmitBytes(StringRef(Buffer, 4));