MC: split Win64EHUnwindEmitter into a shared streamer
[oota-llvm.git] / lib / MC / MCAsmStreamer.cpp
index 14f0f05edd1f6fd12ab568733b5fcfb378eaa4ea..27cbd4962f12751b0b660e61c45d31d6d2352b52 100644 (file)
@@ -1109,11 +1109,10 @@ void MCAsmStreamer::EmitWinEHHandlerData() {
   // cause the section switch to be visible in the emitted assembly.
   // We only do this so the section switch that terminates the handler
   // data block is visible.
-  MCWinFrameInfo *CurFrame = getCurrentWinFrameInfo();
-  StringRef suffix=MCWin64EHUnwindEmitter::GetSectionSuffix(CurFrame->Function);
-  const MCSection *xdataSect = getWin64EHTableSection(suffix, getContext());
-  if (xdataSect)
-    SwitchSectionNoChange(xdataSect);
+  WinEH::FrameInfo *CurFrame = getCurrentWinFrameInfo();
+  StringRef Suffix = WinEH::UnwindEmitter::GetSectionSuffix(CurFrame->Function);
+  if (const MCSection *XData = getWin64EHTableSection(Suffix, getContext()))
+    SwitchSectionNoChange(XData);
 
   OS << "\t.seh_handlerdata";
   EmitEOL();