45 class AArch64ELFStreamer;
50 void emitInst(
uint32_t Inst)
override;
56 AArch64TargetAsmStreamer::AArch64TargetAsmStreamer(
MCStreamer &S,
60 void AArch64TargetAsmStreamer::emitInst(
uint32_t Inst) {
89 friend class AArch64TargetELFStreamer;
93 :
MCELFStreamer(Context, TAB, OS, Emitter), MappingSymbolCounter(0),
101 LastEMS = LastMappingSymbols.lookup(Section);
111 EmitA64MappingSymbol();
123 for (
unsigned I = 0;
I < 4; ++
I) {
124 Buffer[
I] = uint8_t(Inst);
128 EmitA64MappingSymbol();
136 EmitDataMappingSymbol();
144 EmitDataMappingSymbol();
149 enum ElfMappingSymbol {
155 void EmitDataMappingSymbol() {
156 if (LastEMS == EMS_Data)
158 EmitMappingSymbol(
"$d");
162 void EmitA64MappingSymbol() {
163 if (LastEMS == EMS_A64)
165 EmitMappingSymbol(
"$x");
171 Name +
"." +
Twine(MappingSymbolCounter++)));
175 Symbol->setExternal(
false);
178 int64_t MappingSymbolCounter;
181 ElfMappingSymbol LastEMS;
185 AArch64ELFStreamer &AArch64TargetELFStreamer::getStreamer() {
186 return static_cast<AArch64ELFStreamer &
>(Streamer);
189 void AArch64TargetELFStreamer::emitInst(
uint32_t Inst) {
190 getStreamer().emitInst(Inst);
198 return new AArch64TargetAsmStreamer(S, OS);
204 AArch64ELFStreamer *S =
new AArch64ELFStreamer(Context, TAB, OS, Emitter);
206 S->getAssembler().setRelaxAll(
true);
214 return new AArch64TargetELFStreamer(S);
Instances of this class represent a uniqued identifier for a section in the current translation unit...
MCSectionSubPair getPreviousSection() const
Return the previous section that the streamer is emitting code to.
void EmitBytes(StringRef Data) override
Emit the bytes in Data into the output.
Target specific streamer interface.
virtual void emitInst(uint32_t Inst)
Callback used to implement the .inst directive.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Base class for the full range of assembler expressions which are needed for parsing.
void EmitLabel(MCSymbol *Symbol) override
Emit a label for Symbol into the current section.
MCContext & getContext() const
Context object for machine code objects.
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
Instances of this class represent a single low-level machine instruction.
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
Streaming machine code generation interface.
MCCodeEmitter - Generic instruction encoding interface.
MCELFStreamer * createAArch64ELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll)
Triple - Helper class for working with autoconf configuration names.
MCTargetStreamer * createAArch64ObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
MCStreamer & getStreamer()
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
MCTargetStreamer * createAArch64AsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
MCSubtargetInfo - Generic base class for all target subtargets.
const Triple & getTargetTriple() const
getTargetTriple - Return the target triple string.
static std::string utohexstr(uint64_t X, bool LowerCase=false)
An abstract base class for streams implementations that also support a pwrite operation.
cl::opt< bool > RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, ""relax all fixups in the emitted object file"))
LLVM Value Representation.
Generic interface to target specific assembler backends.
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.