43 class AArch64ELFStreamer;
48 void emitInst(
uint32_t Inst)
override;
54 AArch64TargetAsmStreamer::AArch64TargetAsmStreamer(
MCStreamer &S,
58 void AArch64TargetAsmStreamer::emitInst(
uint32_t Inst) {
87 friend class AArch64TargetELFStreamer;
91 :
MCELFStreamer(Context, TAB, OS, Emitter), MappingSymbolCounter(0),
99 LastEMS = LastMappingSymbols.lookup(Section);
109 EmitA64MappingSymbol();
121 for (
unsigned I = 0;
I < 4; ++
I) {
122 Buffer[
I] = uint8_t(Inst);
126 EmitA64MappingSymbol();
134 EmitDataMappingSymbol();
142 EmitDataMappingSymbol();
147 enum ElfMappingSymbol {
153 void EmitDataMappingSymbol() {
154 if (LastEMS == EMS_Data)
156 EmitMappingSymbol(
"$d");
160 void EmitA64MappingSymbol() {
161 if (LastEMS == EMS_A64)
163 EmitMappingSymbol(
"$x");
169 Name +
"." +
Twine(MappingSymbolCounter++)));
173 Symbol->setExternal(
false);
176 int64_t MappingSymbolCounter;
179 ElfMappingSymbol LastEMS;
184 AArch64ELFStreamer &AArch64TargetELFStreamer::getStreamer() {
185 return static_cast<AArch64ELFStreamer &
>(Streamer);
188 void AArch64TargetELFStreamer::emitInst(
uint32_t Inst) {
189 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);
216 return new AArch64TargetWinCOFFStreamer(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.
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)
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Triple - Helper class for working with autoconf configuration names.
MCTargetStreamer * createAArch64ObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
MCStreamer & getStreamer()
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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.
void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
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.
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool=false) override
Emit the given Instruction into the current section.