summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCWin64EH.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-08-03 18:51:17 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-08-03 18:51:17 +0000
commitb3be7371d59b9b4262dd0a440580ce67a889d81a (patch)
tree4beb77a164c9623c164db5889a5a8df8c5f7b20d /llvm/lib/MC/MCWin64EH.cpp
parent3ab94b910bec14e4055a44eb4c652000589ea028 (diff)
downloadbcm5719-llvm-b3be7371d59b9b4262dd0a440580ce67a889d81a.tar.gz
bcm5719-llvm-b3be7371d59b9b4262dd0a440580ce67a889d81a.zip
MC: rename Win64EHFrameInfo to WinEH::FrameInfo
The frame information stored in this structure is driven by the requirements for Windows NT unwinding rather than Windows 64 specifically. As a result, this type can be shared across multiple architectures (ARM, AXP, MIPS, PPC, SH). Rename this class in preparation for adding support for supporting unwinding information for Windows on ARM. Take the opportunity to constify the members as everything except the ChainedParent is read-only. This required some adjustment to the label handling. llvm-svn: 214663
Diffstat (limited to 'llvm/lib/MC/MCWin64EH.cpp')
-rw-r--r--llvm/lib/MC/MCWin64EH.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp
index 95e19839372..e59854c1c79 100644
--- a/llvm/lib/MC/MCWin64EH.cpp
+++ b/llvm/lib/MC/MCWin64EH.cpp
@@ -56,7 +56,7 @@ static void EmitAbsDifference(MCStreamer &Streamer, const MCSymbol *LHS,
Streamer.EmitAbsValue(Diff, 1);
}
-static void EmitUnwindCode(MCStreamer &streamer, MCSymbol *begin,
+static void EmitUnwindCode(MCStreamer &streamer, const MCSymbol *begin,
WinEH::Instruction &inst) {
uint8_t b2;
uint16_t w;
@@ -136,7 +136,7 @@ static void EmitSymbolRefWithOfs(MCStreamer &streamer,
}
static void EmitRuntimeFunction(MCStreamer &streamer,
- const MCWinFrameInfo *info) {
+ const WinEH::FrameInfo *info) {
MCContext &context = streamer.getContext();
streamer.EmitValueToAlignment(4);
@@ -147,14 +147,17 @@ static void EmitRuntimeFunction(MCStreamer &streamer,
context), 4);
}
-static void EmitUnwindInfo(MCStreamer &streamer, MCWinFrameInfo *info) {
+static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
// If this UNWIND_INFO already has a symbol, it's already been emitted.
- if (info->Symbol) return;
+ if (info->Symbol)
+ return;
MCContext &context = streamer.getContext();
+ MCSymbol *Label = context.CreateTempSymbol();
+
streamer.EmitValueToAlignment(4);
- info->Symbol = context.CreateTempSymbol();
- streamer.EmitLabel(info->Symbol);
+ streamer.EmitLabel(Label);
+ info->Symbol = Label;
// Upper 3 bits are the version number (currently 1).
uint8_t flags = 0x01;
@@ -256,7 +259,7 @@ static const MCSection *getWin64EHFuncTableSection(StringRef suffix,
}
void MCWin64EHUnwindEmitter::EmitUnwindInfo(MCStreamer &streamer,
- MCWinFrameInfo *info) {
+ WinEH::FrameInfo *info) {
// Switch sections (the static function above is meant to be called from
// here and from Emit().
MCContext &context = streamer.getContext();
OpenPOWER on IntegriCloud