diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-09 00:17:29 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-09 00:17:29 +0000 |
commit | 1fe9737eb49ecb80fbb547f0e16e10a726cd53cf (patch) | |
tree | f9cf4ec79a43cdfb1a05d3c71aa47af7d7010bcd /lib/MC | |
parent | 39f227e4dd98d36ed852175825c3a74c05614bd6 (diff) | |
download | external_llvm-1fe9737eb49ecb80fbb547f0e16e10a726cd53cf.zip external_llvm-1fe9737eb49ecb80fbb547f0e16e10a726cd53cf.tar.gz external_llvm-1fe9737eb49ecb80fbb547f0e16e10a726cd53cf.tar.bz2 |
Don't print an unused label before .cfi_endproc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147763 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 14 | ||||
-rw-r--r-- | lib/MC/MCObjectStreamer.cpp | 4 | ||||
-rw-r--r-- | lib/MC/MCStreamer.cpp | 11 |
3 files changed, 22 insertions, 7 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index d70db24..13b2a39 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -62,6 +62,7 @@ private: void EmitRegisterName(int64_t Register); virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame); + virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame); public: MCAsmStreamer(MCContext &Context, formatted_raw_ostream &os, @@ -210,7 +211,6 @@ public: StringRef FileName); virtual void EmitCFISections(bool EH, bool Debug); - virtual void EmitCFIEndProc(); virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset); virtual void EmitCFIDefCfaOffset(int64_t Offset); virtual void EmitCFIDefCfaRegister(int64_t Register); @@ -851,11 +851,15 @@ void MCAsmStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) { EmitEOL(); } -void MCAsmStreamer::EmitCFIEndProc() { - MCStreamer::EmitCFIEndProc(); - - if (!UseCFI) +void MCAsmStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) { + if (!UseCFI) { + RecordProcEnd(Frame); return; + } + + // Put a dummy non-null value in Frame.End to mark that this frame has been + // closed. + Frame.End = (MCSymbol *) 1; OS << "\t.cfi_endproc"; EmitEOL(); diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index ffe3362..6159e0e 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -109,6 +109,10 @@ void MCObjectStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) { RecordProcStart(Frame); } +void MCObjectStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) { + RecordProcEnd(Frame); +} + void MCObjectStreamer::EmitLabel(MCSymbol *Symbol) { MCStreamer::EmitLabel(Symbol); diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 145489a..7bbb379 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -301,8 +301,15 @@ void MCStreamer::RecordProcStart(MCDwarfFrameInfo &Frame) { void MCStreamer::EmitCFIEndProc() { EnsureValidFrame(); MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo(); - CurFrame->End = getContext().CreateTempSymbol(); - EmitLabel(CurFrame->End); + EmitCFIEndProcImpl(*CurFrame); +} + +void MCStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) { +} + +void MCStreamer::RecordProcEnd(MCDwarfFrameInfo &Frame) { + Frame.End = getContext().CreateTempSymbol(); + EmitLabel(Frame.End); } void MCStreamer::EmitCFIDefCfa(int64_t Register, int64_t Offset) { |