MC: split Win64EHUnwindEmitter into a shared streamer

This changes Win64EHEmitter into a utility WinEH UnwindEmitter that can be
shared across multiple architectures and a target specific bit which is
overridden (Win64::UnwindEmitter).  This enables sharing the section selection
code across X86 and the intended use in ARM for emitting unwind information for
Windows on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool
2014-08-07 02:59:41 +00:00
parent 15c8452584
commit 7cc1de1090
7 changed files with 115 additions and 74 deletions

View File

@@ -20,9 +20,8 @@
#include <vector>
namespace llvm {
class StringRef;
class MCStreamer;
class MCSymbol;
class MCStreamer;
class MCSymbol;
namespace Win64EH {
struct Instruction {
@@ -52,17 +51,13 @@ struct Instruction {
return WinEH::Instruction(UOP_SetFPReg, L, Reg, Off);
}
};
}
class MCWin64EHUnwindEmitter {
public:
static StringRef GetSectionSuffix(const MCSymbol *func);
//
// This emits the unwind info sections (.pdata and .xdata in PE/COFF).
//
static void Emit(MCStreamer &streamer);
static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info);
};
class UnwindEmitter : public WinEH::UnwindEmitter {
public:
void Emit(MCStreamer &Streamer) const override;
void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI) const override;
};
}
} // end namespace llvm
#endif