From 7a3264e5d2ade66440d4f26a3f7704551c0f7852 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 9 Aug 2014 17:21:36 +0000 Subject: [PATCH] MC: remove duplicated code This removes the duplicate definition of GetXDataSection. This function is available as a static method and is identical to the previous implementation. This just cleans up the unnecessary duplication. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215289 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCAsmStreamer.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 27cbd4962f1..dc6133e7fa1 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -1089,19 +1089,6 @@ void MCAsmStreamer::EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, EmitEOL(); } -static const MCSection *getWin64EHTableSection(StringRef suffix, - MCContext &context) { - // FIXME: This doesn't belong in MCObjectFileInfo. However, - /// this duplicate code in MCWin64EH.cpp. - if (suffix == "") - return context.getObjectFileInfo()->getXDataSection(); - return context.getCOFFSection((".xdata"+suffix).str(), - COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | - COFF::IMAGE_SCN_MEM_READ | - COFF::IMAGE_SCN_MEM_WRITE, - SectionKind::getDataRel()); -} - void MCAsmStreamer::EmitWinEHHandlerData() { MCStreamer::EmitWinEHHandlerData(); @@ -1111,7 +1098,8 @@ void MCAsmStreamer::EmitWinEHHandlerData() { // data block is visible. WinEH::FrameInfo *CurFrame = getCurrentWinFrameInfo(); StringRef Suffix = WinEH::UnwindEmitter::GetSectionSuffix(CurFrame->Function); - if (const MCSection *XData = getWin64EHTableSection(Suffix, getContext())) + if (const MCSection *XData = + WinEH::UnwindEmitter::GetXDataSection(Suffix, getContext())) SwitchSectionNoChange(XData); OS << "\t.seh_handlerdata"; -- 2.11.0