Make BuildSymbolDiff an static helper.
[oota-llvm.git] / lib / MC / MCAsmStreamer.cpp
index 27cbd4962f12751b0b660e61c45d31d6d2352b52..fcf39b836fcd8c477d589dc3ffabc6c6a0e629f4 100644 (file)
@@ -700,7 +700,6 @@ void MCAsmStreamer::EmitULEB128Value(const MCExpr *Value) {
     EmitULEB128IntValue(IntValue);
     return;
   }
-  assert(MAI->hasLEB128() && "Cannot print a .uleb");
   OS << ".uleb128 " << *Value;
   EmitEOL();
 }
@@ -711,7 +710,6 @@ void MCAsmStreamer::EmitSLEB128Value(const MCExpr *Value) {
     EmitSLEB128IntValue(IntValue);
     return;
   }
-  assert(MAI->hasLEB128() && "Cannot print a .sleb");
   OS << ".sleb128 " << *Value;
   EmitEOL();
 }
@@ -1089,19 +1087,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 +1096,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";