From c607d8e7be1594445d2fd53aac90e4143a9c40cc Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 24 Jun 2014 23:54:40 +0000 Subject: [PATCH] Simplify EmitLabel. All the "real" streamers were already calling to MCStreamer::EmitLabel to do part of the work. llvm-svn: 211646 --- llvm/lib/LTO/LTOModule.cpp | 2 +- llvm/lib/MC/MCNullStreamer.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp index 50ddaa12a4c0..05c384d71160 100644 --- a/llvm/lib/LTO/LTOModule.cpp +++ b/llvm/lib/LTO/LTOModule.cpp @@ -653,7 +653,7 @@ namespace { AddValueSymbols(Inst.getOperand(i).getExpr()); } void EmitLabel(MCSymbol *Symbol) override { - Symbol->setSection(*getCurrentSection().first); + MCStreamer::EmitLabel(Symbol); markDefined(*Symbol); } void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override { diff --git a/llvm/lib/MC/MCNullStreamer.cpp b/llvm/lib/MC/MCNullStreamer.cpp index 5fa14c978928..ca162a434973 100644 --- a/llvm/lib/MC/MCNullStreamer.cpp +++ b/llvm/lib/MC/MCNullStreamer.cpp @@ -28,11 +28,6 @@ namespace { const MCExpr *Subsection) override { } - void EmitLabel(MCSymbol *Symbol) override { - assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); - assert(getCurrentSection().first &&"Cannot emit before setting section!"); - AssignSection(Symbol, getCurrentSection().first); - } void EmitAssemblerFlag(MCAssemblerFlag Flag) override {} void EmitThumbFunc(MCSymbol *Func) override {}