diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-28 15:54:36 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-28 15:54:36 +0000 |
commit | f90a2de72c25e24f26577b0dd8145ac21fe10f5e (patch) | |
tree | 3b13e72595e8cab716f1754fccfdfe3f1b07af4b /lib/MC/WinCOFFStreamer.cpp | |
parent | 175ccab75f3a355285cf4533c201cbcecfd5928d (diff) |
Factor some duplicated code into MCObjectStreamer::EmitLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/WinCOFFStreamer.cpp')
-rw-r--r-- | lib/MC/WinCOFFStreamer.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/MC/WinCOFFStreamer.cpp b/lib/MC/WinCOFFStreamer.cpp index cba7188267..1754ed3095 100644 --- a/lib/MC/WinCOFFStreamer.cpp +++ b/lib/MC/WinCOFFStreamer.cpp @@ -49,7 +49,6 @@ public: // MCStreamer interface virtual void InitSections(); - virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitAssemblerFlag(MCAssemblerFlag Flag); virtual void EmitThumbFunc(MCSymbol *Func); virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value); @@ -175,28 +174,6 @@ void WinCOFFStreamer::InitSections() { SetSectionText(); } -void WinCOFFStreamer::EmitLabel(MCSymbol *Symbol) { - // TODO: This is copied almost exactly from the MachOStreamer. Consider - // merging into MCObjectStreamer? - assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); - assert(!Symbol->isVariable() && "Cannot emit a variable symbol!"); - assert(CurSection && "Cannot emit before setting section!"); - - Symbol->setSection(*CurSection); - - MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); - - // FIXME: This is wasteful, we don't necessarily need to create a data - // fragment. Instead, we should mark the symbol as pointing into the data - // fragment if it exists, otherwise we should just queue the label and set its - // fragment pointer when we emit the next fragment. - MCDataFragment *DF = getOrCreateDataFragment(); - - assert(!SD.getFragment() && "Unexpected fragment on symbol data!"); - SD.setFragment(DF); - SD.setOffset(DF->getContents().size()); -} - void WinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) { llvm_unreachable("not implemented"); } |