mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Implement the Win64 EH directive methods for the assembly language streamer.
GAS has no such directives (not even mingw-w64 GAS has them), so I took creative license with their names in assembly. I prefixed them all with "w64_" to avoid namespace collisions, for example. If I discover that GAS has taken a different approach, I'll change ours to match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
54f0d1e021
commit
0e30f02f44
@ -208,6 +208,15 @@ public:
|
||||
virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
|
||||
virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
|
||||
|
||||
virtual void EmitWin64EHStartProc(MCSymbol *Symbol, MCSymbol *EHandler = 0);
|
||||
virtual void EmitWin64EHEndProc();
|
||||
virtual void EmitWin64EHPushReg(int64_t Register);
|
||||
virtual void EmitWin64EHSetFrame(int64_t Register, int64_t Offset);
|
||||
virtual void EmitWin64EHAllocStack(int64_t Size);
|
||||
virtual void EmitWin64EHSaveReg(int64_t Register, int64_t Offset);
|
||||
virtual void EmitWin64EHPushFrame(bool Code);
|
||||
virtual void EmitWin64EHEndProlog();
|
||||
|
||||
virtual void EmitFnStart();
|
||||
virtual void EmitFnEnd();
|
||||
virtual void EmitCantUnwind();
|
||||
@ -915,6 +924,74 @@ void MCAsmStreamer::EmitCFIAdjustCfaOffset(int64_t Adjustment) {
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHStartProc(MCSymbol *Symbol, MCSymbol *EHandler)
|
||||
{
|
||||
//MCStreamer::EmitWin64EHStartProc(Symbol, EHandler);
|
||||
|
||||
OS << ".w64_startproc " << *Symbol;
|
||||
if (EHandler)
|
||||
OS << ", " << *EHandler;
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHEndProc()
|
||||
{
|
||||
//MCStreamer::EmitWin64EHEndProc();
|
||||
|
||||
OS << "\t.w64_endproc";
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHPushReg(int64_t Register)
|
||||
{
|
||||
//MCStreamer::EmitWin64EHPushReg(Register);
|
||||
|
||||
OS << "\t.w64_pushreg " << Register;
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHSetFrame(int64_t Register, int64_t Offset)
|
||||
{
|
||||
//MCStreamer::EmitWin64EHSetFrame(Register, Offset);
|
||||
|
||||
OS << "\t.w64_setframe " << Register << ", " << Offset;
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHAllocStack(int64_t Size)
|
||||
{
|
||||
//MCStremaer::EmitWin64EHAllocStack(Size);
|
||||
|
||||
OS << "\t.w64_allocstack " << Size;
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHSaveReg(int64_t Register, int64_t Offset)
|
||||
{
|
||||
//MCStreamer::EmitWin64EHSaveReg(Register, Offset)
|
||||
|
||||
OS << "\t.w64_savereg " << Register << ", " << Offset;
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHPushFrame(bool Code)
|
||||
{
|
||||
//MCStreamer::EmitWin64EHPushFrame(Code);
|
||||
|
||||
OS << "\t.w64_pushframe";
|
||||
if (Code)
|
||||
OS << " " << "code";
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitWin64EHEndProlog(void)
|
||||
{
|
||||
//MCStreamer::EmitWin64EHEndProlog();
|
||||
|
||||
OS << "\t.w64_endprolog";
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::AddEncodingComment(const MCInst &Inst) {
|
||||
raw_ostream &OS = GetCommentOS();
|
||||
SmallString<256> Code;
|
||||
|
Loading…
x
Reference in New Issue
Block a user