45class AArch64ELFStreamer;
53 OS <<
"\t.variant_pcs\t" <<
Symbol->getName() <<
"\n";
57 OS <<
"\t.seh_stackalloc\t" <<
Size <<
"\n";
60 OS <<
"\t.seh_save_r19r20_x\t" <<
Offset <<
"\n";
63 OS <<
"\t.seh_save_fplr\t" <<
Offset <<
"\n";
66 OS <<
"\t.seh_save_fplr_x\t" <<
Offset <<
"\n";
69 OS <<
"\t.seh_save_reg\tx" <<
Reg <<
", " <<
Offset <<
"\n";
72 OS <<
"\t.seh_save_reg_x\tx" <<
Reg <<
", " <<
Offset <<
"\n";
75 OS <<
"\t.seh_save_regp\tx" <<
Reg <<
", " <<
Offset <<
"\n";
78 OS <<
"\t.seh_save_regp_x\tx" <<
Reg <<
", " <<
Offset <<
"\n";
81 OS <<
"\t.seh_save_lrpair\tx" <<
Reg <<
", " <<
Offset <<
"\n";
84 OS <<
"\t.seh_save_freg\td" <<
Reg <<
", " <<
Offset <<
"\n";
87 OS <<
"\t.seh_save_freg_x\td" <<
Reg <<
", " <<
Offset <<
"\n";
90 OS <<
"\t.seh_save_fregp\td" <<
Reg <<
", " <<
Offset <<
"\n";
93 OS <<
"\t.seh_save_fregp_x\td" <<
Reg <<
", " <<
Offset <<
"\n";
97 OS <<
"\t.seh_add_fp\t" <<
Size <<
"\n";
109 OS <<
"\t.seh_clear_unwound_to_call\n";
112 OS <<
"\t.seh_pac_sign_lr\n";
116 OS <<
"\t.seh_save_any_reg\tx" <<
Reg <<
", " <<
Offset <<
"\n";
119 OS <<
"\t.seh_save_any_reg_p\tx" <<
Reg <<
", " <<
Offset <<
"\n";
122 OS <<
"\t.seh_save_any_reg\td" <<
Reg <<
", " <<
Offset <<
"\n";
125 OS <<
"\t.seh_save_any_reg_p\td" <<
Reg <<
", " <<
Offset <<
"\n";
128 OS <<
"\t.seh_save_any_reg\tq" <<
Reg <<
", " <<
Offset <<
"\n";
131 OS <<
"\t.seh_save_any_reg_p\tq" <<
Reg <<
", " <<
Offset <<
"\n";
134 OS <<
"\t.seh_save_any_reg_x\tx" <<
Reg <<
", " <<
Offset <<
"\n";
137 OS <<
"\t.seh_save_any_reg_px\tx" <<
Reg <<
", " <<
Offset <<
"\n";
140 OS <<
"\t.seh_save_any_reg_x\td" <<
Reg <<
", " <<
Offset <<
"\n";
143 OS <<
"\t.seh_save_any_reg_px\td" <<
Reg <<
", " <<
Offset <<
"\n";
146 OS <<
"\t.seh_save_any_reg_x\tq" <<
Reg <<
", " <<
Offset <<
"\n";
149 OS <<
"\t.seh_save_any_reg_px\tq" <<
Reg <<
", " <<
Offset <<
"\n";
156AArch64TargetAsmStreamer::AArch64TargetAsmStreamer(
MCStreamer &S,
160void AArch64TargetAsmStreamer::emitInst(
uint32_t Inst) {
179 AArch64ELFStreamer(
MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
180 std::unique_ptr<MCObjectWriter> OW,
181 std::unique_ptr<MCCodeEmitter>
Emitter)
184 MappingSymbolCounter(0), LastEMS(EMS_None) {}
191 LastEMS = LastMappingSymbols.lookup(Section);
197 void reset()
override {
198 MappingSymbolCounter = 0;
200 LastMappingSymbols.clear();
209 emitA64MappingSymbol();
221 for (
char &
C : Buffer) {
226 emitA64MappingSymbol();
234 emitDataMappingSymbol();
242 emitDataMappingSymbol();
247 SMLoc Loc)
override {
248 emitDataMappingSymbol();
252 enum ElfMappingSymbol {
258 void emitDataMappingSymbol() {
259 if (LastEMS == EMS_Data)
261 emitMappingSymbol(
"$d");
265 void emitA64MappingSymbol() {
266 if (LastEMS == EMS_A64)
268 emitMappingSymbol(
"$x");
274 Name +
"." +
Twine(MappingSymbolCounter++)));
278 Symbol->setExternal(
false);
281 int64_t MappingSymbolCounter;
284 ElfMappingSymbol LastEMS;
289AArch64ELFStreamer &AArch64TargetELFStreamer::getStreamer() {
290 return static_cast<AArch64ELFStreamer &
>(
Streamer);
293void AArch64TargetELFStreamer::emitInst(
uint32_t Inst) {
294 getStreamer().emitInst(Inst);
297void AArch64TargetELFStreamer::emitDirectiveVariantPCS(
MCSymbol *Symbol) {
298 getStreamer().getAssembler().registerSymbol(*Symbol);
306 return new AArch64TargetAsmStreamer(S,
OS);
310 MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
311 std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter>
Emitter,
313 AArch64ELFStreamer *S =
new AArch64ELFStreamer(
316 S->getAssembler().setRelaxAll(
true);
dxil DXContainer Global Emitter
This file defines the DenseMap class.
virtual void emitARM64WinCFISaveAnyRegIX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveRegP(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveAnyRegQX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveAnyRegDPX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveAnyRegDX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveRegPX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveAnyRegQ(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveAnyRegQP(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveAnyRegD(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveFReg(unsigned Reg, int Offset)
virtual void emitARM64WinCFIPACSignLR()
virtual void emitARM64WinCFISaveAnyRegI(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveFRegPX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveRegX(unsigned Reg, int Offset)
virtual void emitARM64WinCFIAllocStack(unsigned Size)
virtual void emitARM64WinCFISaveFPLRX(int Offset)
virtual void emitARM64WinCFISaveNext()
virtual void emitDirectiveVariantPCS(MCSymbol *Symbol)
Callback used to implement the .variant_pcs directive.
virtual void emitARM64WinCFISaveR19R20X(int Offset)
virtual void emitARM64WinCFIAddFP(unsigned Size)
virtual void emitARM64WinCFISaveFPLR(int Offset)
virtual void emitARM64WinCFIClearUnwoundToCall()
virtual void emitARM64WinCFISaveFRegP(unsigned Reg, int Offset)
virtual void emitARM64WinCFIECContext()
virtual void emitARM64WinCFISaveAnyRegQPX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveFRegX(unsigned Reg, int Offset)
virtual void emitARM64WinCFISetFP()
virtual void emitARM64WinCFISaveAnyRegDP(unsigned Reg, int Offset)
virtual void emitARM64WinCFISaveAnyRegIPX(unsigned Reg, int Offset)
virtual void emitARM64WinCFIEpilogEnd()
virtual void emitARM64WinCFIMachineFrame()
virtual void emitARM64WinCFIPrologEnd()
virtual void emitARM64WinCFITrapFrame()
virtual void emitARM64WinCFIContext()
virtual void emitARM64WinCFISaveReg(unsigned Reg, int Offset)
virtual void emitARM64WinCFINop()
virtual void emitARM64WinCFISaveLRPair(unsigned Reg, int Offset)
virtual void emitInst(uint32_t Inst)
Callback used to implement the .inst directive.
virtual void emitARM64WinCFIEpilogStart()
virtual void emitARM64WinCFISaveAnyRegIP(unsigned Reg, int Offset)
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.
void reset() override
state management
void changeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Base class for the full range of assembler expressions which are needed for parsing.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Instances of this class represent a single low-level machine instruction.
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) override
Emit Size bytes worth of the value specified by FillValue.
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
MCSectionSubPair getPreviousSection() const
Return the previous section that the streamer is emitting code to.
MCContext & getContext() const
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Target specific streamer interface.
Represents a location in source code.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static Twine utohexstr(const uint64_t &Val)
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
@ STO_AARCH64_VARIANT_PCS
Reg
All possible values of the reg field in the ModR/M byte.
This is an optimization pass for GlobalISel generic memory operations.
MCELFStreamer * createAArch64ELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter, bool RelaxAll)
MCTargetStreamer * createAArch64AsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.