Add some more Win64 EH directives:

- StartChained and EndChained delimit a chained unwind area, which can contain
  additional operations to be undone if an exception occurs inside of it.
- UnwindOnly declares that this function doesn't handle any exceptions. If it
  has a handler, it's an unwind handler instead of an exception handler.
- Lsda declares the location and size of the LSDA, which in the Win64 EH
  scheme is kept inside the UNWIND_INFO struct. Windows itself ignores the
  LSDA; it's used by the Language-Specific Handler (the "Personality Function"
  from DWARF).

llvm-svn: 131572
This commit is contained in:
Charles Davis 2011-05-18 20:54:10 +00:00
parent 583805530c
commit 77e0610d7c
3 changed files with 64 additions and 0 deletions

View File

@ -459,6 +459,10 @@ namespace llvm {
virtual void EmitWin64EHStartProc(MCSymbol *Symbol, MCSymbol *EHandler = 0);
virtual void EmitWin64EHEndProc();
virtual void EmitWin64EHStartChained();
virtual void EmitWin64EHEndChained();
virtual void EmitWin64EHUnwindOnly();
virtual void EmitWin64EHLsda(const MCSymbol *Sym, int64_t Size);
virtual void EmitWin64EHPushReg(int64_t Register);
virtual void EmitWin64EHSetFrame(int64_t Register, int64_t Offset);
virtual void EmitWin64EHAllocStack(int64_t Size);

View File

@ -210,6 +210,10 @@ public:
virtual void EmitWin64EHStartProc(MCSymbol *Symbol, MCSymbol *EHandler = 0);
virtual void EmitWin64EHEndProc();
virtual void EmitWin64EHStartChained();
virtual void EmitWin64EHEndChained();
virtual void EmitWin64EHUnwindOnly();
virtual void EmitWin64EHLsda(cosnt MCSymbol *Sym, int64_t Size);
virtual void EmitWin64EHPushReg(int64_t Register);
virtual void EmitWin64EHSetFrame(int64_t Register, int64_t Offset);
virtual void EmitWin64EHAllocStack(int64_t Size);
@ -942,6 +946,38 @@ void MCAsmStreamer::EmitWin64EHEndProc()
EmitEOL();
}
void MCAsmStreamer::EmitWin64EHStartChained()
{
//MCStreamer::EmitWin64EHStartChained();
OS << "\t.w64_startchained";
EmitEOL();
}
void MCAsmStreamer::EmitWin64EHEndChained()
{
//MCStreamer::EmitWin64EHEndChained();
OS << "\t.w64_endchained";
EmitEOL();
}
void MCAsmStreamer::EmitWin64EHUnwindOnly()
{
//MCStreamer::EmitWin64EHUnwindOnly();
OS << "\t.w64_unwind_only";
EmitEOL();
}
void MCAsmStreamer::EmitWin64EHLsda(cosnt MCSymbol *Sym, int64_t Size)
{
//MCStreamer::EmitWin64EHLsda(Sym, Size);
OS << "\t.w64_lsda " << *Sym << ", " << Size;
EmitEOL();
}
void MCAsmStreamer::EmitWin64EHPushReg(int64_t Register)
{
//MCStreamer::EmitWin64EHPushReg(Register);

View File

@ -322,6 +322,30 @@ void MCStreamer::EmitWin64EHEndProc()
abort();
}
void MCStreamer::EmitWin64EHStartChained()
{
errs() << "Not implemented yet\n";
abort();
}
void MCStreamer::EmitWin64EHEndChained()
{
errs() << "Not implemented yet\n";
abort();
}
void MCStreamer::EmitWin64EHUnwindOnly()
{
errs() << "Not implemented yet\n";
abort();
}
void MCStreamer::EmitWin64EHLsda(const MCSymbol *Sym, int64_t Size)
{
errs() << "Not implemented yet\n";
abort();
}
void MCStreamer::EmitWin64EHPushReg(int64_t Register)
{
errs() << "Not implemented yet\n";