25 ARMWinCOFFStreamer(
MCContext &
C, std::unique_ptr<MCAsmBackend> AB,
26 std::unique_ptr<MCCodeEmitter> CE,
27 std::unique_ptr<MCObjectWriter> OW)
38void ARMWinCOFFStreamer::emitWinEHHandlerData(
SMLoc Loc) {
43 EHStreamer.EmitUnwindInfo(*
this, getCurrentWinFrameInfo(),
48 EHStreamer.EmitUnwindInfo(*
this, Frame,
false);
51void ARMWinCOFFStreamer::emitWindowsUnwindTables() {
52 if (!getNumWinFrameInfos())
57void ARMWinCOFFStreamer::emitThumbFunc(
MCSymbol *Symbol) {
58 getAssembler().setIsThumbFunc(Symbol);
61void ARMWinCOFFStreamer::finishImpl() {
63 emitWindowsUnwindTables();
71 std::unique_ptr<MCAsmBackend> &&MAB,
72 std::unique_ptr<MCObjectWriter> &&OW,
73 std::unique_ptr<MCCodeEmitter> &&
Emitter) {
74 return new ARMWinCOFFStreamer(Context, std::move(MAB), std::move(
Emitter),
82 bool InEpilogCFI =
false;
104 void emitARMWinUnwindCode(
unsigned UnwindCode,
int Reg,
int Offset);
109void ARMTargetWinCOFFStreamer::emitARMWinUnwindCode(
unsigned UnwindCode,
111 auto &S = getStreamer();
118 CurFrame->
EpilogMap[CurrentEpilog].Instructions.push_back(Inst);
123void ARMTargetWinCOFFStreamer::emitARMWinCFIAllocStack(
unsigned Size,
127 if (
Size / 4 > 0xffff)
129 else if (
Size / 4 > 0x7f)
133 if (
Size / 4 > 0xffff)
135 else if (
Size / 4 > 0x3ff)
138 emitARMWinUnwindCode(
Op, -1,
Size);
141void ARMTargetWinCOFFStreamer::emitARMWinCFISaveRegMask(
unsigned Mask,
144 int Lr = (
Mask & 0x4000) ? 1 : 0;
147 assert((Mask & ~0x1fff) == 0);
149 assert((Mask & ~0x00ff) == 0);
150 if (Mask && ((Mask + (1 << 4)) & Mask) == 0) {
151 if (Wide && (Mask & 0x1000) == 0 && (Mask & 0xff) == 0xf0) {
153 for (
int I = 11;
I >= 8;
I--) {
154 if (Mask & (1 <<
I)) {
162 for (
int I = 7;
I >= 4;
I--) {
163 if (Mask & (1 <<
I)) {
178void ARMTargetWinCOFFStreamer::emitARMWinCFISaveSP(
unsigned Reg) {
182void ARMTargetWinCOFFStreamer::emitARMWinCFISaveFRegs(
unsigned First,
189 else if (
First <= 15)
195void ARMTargetWinCOFFStreamer::emitARMWinCFISaveLR(
unsigned Offset) {
199void ARMTargetWinCOFFStreamer::emitARMWinCFINop(
bool Wide) {
206void ARMTargetWinCOFFStreamer::emitARMWinCFIPrologEnd(
bool Fragment) {
207 auto &S = getStreamer();
221void ARMTargetWinCOFFStreamer::emitARMWinCFIEpilogStart(
unsigned Condition) {
222 auto &S = getStreamer();
228 CurrentEpilog = S.emitCFILabel();
229 CurFrame->
EpilogMap[CurrentEpilog].Condition = Condition;
232void ARMTargetWinCOFFStreamer::emitARMWinCFIEpilogEnd() {
233 auto &S = getStreamer();
238 if (!CurrentEpilog) {
239 S.getContext().reportError(
SMLoc(),
"Stray .seh_endepilogue in " +
244 std::vector<WinEH::Instruction> &
Epilog =
245 CurFrame->
EpilogMap[CurrentEpilog].Instructions;
261 CurFrame->
EpilogMap[CurrentEpilog].Instructions.push_back(Inst);
264 CurrentEpilog =
nullptr;
267void ARMTargetWinCOFFStreamer::emitARMWinCFICustom(
unsigned Opcode) {
274 return new ARMTargetWinCOFFStreamer(S);
dxil DXContainer Global Emitter
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
virtual void emitARMWinCFISaveSP(unsigned Reg)
virtual void emitARMWinCFISaveLR(unsigned Offset)
virtual void emitARMWinCFIAllocStack(unsigned Size, bool Wide)
virtual void emitARMWinCFICustom(unsigned Opcode)
virtual void emitARMWinCFISaveRegMask(unsigned Mask, bool Wide)
virtual void emitARMWinCFIEpilogEnd()
virtual void emitARMWinCFIPrologEnd(bool Fragment)
virtual void emitARMWinCFISaveFRegs(unsigned First, unsigned Last)
virtual void emitARMWinCFIEpilogStart(unsigned Condition)
virtual void emitARMWinCFINop(bool Wide)
This class represents an Operation in the Expression.
Emits exception handling directives.
Context object for machine code objects.
Streaming machine code generation interface.
virtual void emitWindowsUnwindTables()
virtual void emitWinEHHandlerData(SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef getName() const
getName - Get the symbol name.
Target specific streamer interface.
void emitThumbFunc(MCSymbol *Func) override
Note in the output that the specified Func is a Thumb mode function (ARM target only).
void finishImpl() override
Streamer specific finalization.
void emitWinEHHandlerData(SMLoc Loc) override
Represents a location in source code.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
@ C
The default llvm calling convention, compatible with C.
@ UOP_WideSaveRegsR4R11LR
@ CE
Windows NT (Windows on ARM)
This is an optimization pass for GlobalISel generic memory operations.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
MCTargetStreamer * createARMObjectTargetWinCOFFStreamer(MCStreamer &S)
MCStreamer * createARMWinCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > &&MAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter)
Implement std::hash so that hash_code can be used in STL containers.
std::vector< Instruction > Instructions
const MCSymbol * Function
const MCSymbol * PrologEnd
MapVector< MCSymbol *, Epilog > EpilogMap