LLVM  8.0.0svn
AArch64TargetStreamer.cpp
Go to the documentation of this file.
1 //===- AArch64TargetStreamer.cpp - AArch64TargetStreamer class ------------===//
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 implements the AArch64TargetStreamer class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "AArch64TargetStreamer.h"
15 #include "llvm/MC/ConstantPools.h"
16 
17 using namespace llvm;
18 
19 //
20 // AArch64TargetStreamer Implemenation
21 //
23  : MCTargetStreamer(S), ConstantPools(new AssemblerConstantPools()) {}
24 
26 
27 // The constant pool handling is shared by all AArch64TargetStreamer
28 // implementations.
30  unsigned Size,
31  SMLoc Loc) {
32  return ConstantPools->addEntry(Streamer, Expr, Size, Loc);
33 }
34 
36  ConstantPools->emitForCurrentSection(Streamer);
37 }
38 
39 // finish() - write out any non-empty assembler constant pools.
40 void AArch64TargetStreamer::finish() { ConstantPools->emitAll(Streamer); }
41 
43  char Buffer[4];
44 
45  // We can't just use EmitIntValue here, as that will swap the
46  // endianness on big-endian systems (instructions are always
47  // little-endian).
48  for (unsigned I = 0; I < 4; ++I) {
49  Buffer[I] = uint8_t(Inst);
50  Inst >>= 8;
51  }
52 
53  getStreamer().EmitBytes(StringRef(Buffer, 4));
54 }
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
virtual void EmitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:977
Target specific streamer interface.
Definition: MCStreamer.h:83
virtual void emitInst(uint32_t Inst)
Callback used to implement the .inst directive.
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
const MCExpr * addConstantPoolEntry(const MCExpr *, unsigned Size, SMLoc Loc)
Callback used to implement the ldr= pseudo.
Streaming machine code generation interface.
Definition: MCStreamer.h:183
MCStreamer & getStreamer()
Definition: MCStreamer.h:91
MCStreamer & Streamer
Definition: MCStreamer.h:85
#define I(x, y, z)
Definition: MD5.cpp:58
uint32_t Size
Definition: Profile.cpp:47
void emitCurrentConstantPool()
Callback used to implemnt the .ltorg directive.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Represents a location in source code.
Definition: SMLoc.h:24