diff options
author | Reid Kleckner <rnk@google.com> | 2017-10-10 00:57:36 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-10-10 00:57:36 +0000 |
commit | ab23dace567394515566c13d44dc85acc249651a (patch) | |
tree | 7075c6aff990774313bb1a1728c62a7b86c2bbbe /llvm/lib/MC/MCObjectStreamer.cpp | |
parent | a11b983e11057651613305da1d10a13fc77ffd13 (diff) | |
download | bcm5719-llvm-ab23dace567394515566c13d44dc85acc249651a.tar.gz bcm5719-llvm-ab23dace567394515566c13d44dc85acc249651a.zip |
[MC] Suppress .Lcfi labels when emitting textual assembly
Summary:
This suppresses the generation of .Lcfi labels in our textual assembler.
It was annoying that this generated cascading .Lcfi labels:
llc foo.ll -o - | llvm-mc | llvm-mc
After three trips through MCAsmStreamer, we'd have three labels in the
output when none are necessary. We should only bother creating the
labels and frame data when making a real object file.
This supercedes D38605, which moved the entire .seh_ implementation into
MCObjectStreamer.
This has the advantage that we do more checking when emitting textual
assembly, as a minor efficiency cost. Outputting textual assembly is not
performance critical, so this shouldn't matter.
Reviewers: majnemer, MatzeB
Subscribers: qcolombet, nemanjai, javed.absar, eraman, hiraditya, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D38638
llvm-svn: 315259
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectStreamer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index 0beaf6b095a..65e5b839cae 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -146,6 +146,12 @@ void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, DF->getContents().resize(DF->getContents().size() + Size, 0); } +MCSymbol *MCObjectStreamer::EmitCFILabel() { + MCSymbol *Label = getContext().createTempSymbol("cfi", true); + EmitLabel(Label); + return Label; +} + void MCObjectStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) { // We need to create a local symbol to avoid relocations. Frame.Begin = getContext().createTempSymbol(); |