45 class AArch64ELFStreamer;
50 void emitInst(uint32_t Inst)
override;
56 AArch64TargetAsmStreamer::AArch64TargetAsmStreamer(
MCStreamer &S,
60 void AArch64TargetAsmStreamer::emitInst(uint32_t Inst) {
68 void emitInst(uint32_t Inst)
override;
89 friend class AArch64TargetELFStreamer;
93 :
MCELFStreamer(Context, TAB, OS, Emitter), MappingSymbolCounter(0),
101 LastEMS = LastMappingSymbols.lookup(Section);
111 EmitA64MappingSymbol();
115 void emitInst(uint32_t Inst) {
116 EmitA64MappingSymbol();
124 EmitDataMappingSymbol();
132 const SMLoc &Loc)
override {
133 EmitDataMappingSymbol();
138 enum ElfMappingSymbol {
144 void EmitDataMappingSymbol() {
145 if (LastEMS == EMS_Data)
147 EmitMappingSymbol(
"$d");
151 void EmitA64MappingSymbol() {
152 if (LastEMS == EMS_A64)
154 EmitMappingSymbol(
"$x");
160 Name +
"." +
Twine(MappingSymbolCounter++)));
164 Symbol->setExternal(
false);
167 int64_t MappingSymbolCounter;
170 ElfMappingSymbol LastEMS;
174 AArch64ELFStreamer &AArch64TargetELFStreamer::getStreamer() {
175 return static_cast<AArch64ELFStreamer &
>(Streamer);
178 void AArch64TargetELFStreamer::emitInst(uint32_t Inst) {
179 getStreamer().emitInst(Inst);
187 return new AArch64TargetAsmStreamer(S, OS);
193 AArch64ELFStreamer *S =
new AArch64ELFStreamer(Context, TAB, OS, Emitter);
195 S->getAssembler().setRelaxAll(
true);
203 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.
virtual void EmitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers...
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)
void EmitValueImpl(const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
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.