llvm-6502/lib/MC
David Blaikie fe25521451 Reimplement debug info compression by compressing the whole section, rather than a fragment.
To support compressing the debug_line section that contains multiple
fragments (due, I believe, to variation in choices of line table
encoding depending on the size of instruction ranges in the actual
program code) we needed to support compressing multiple MCFragments in a
single pass.

This patch implements that behavior by mutating the post-relaxed and
relocated section to be the compressed form of its former self,
including renaming the section.

This is a more flexible (and less invasive, to a degree) implementation
that will allow for other features such as "use compression only if it's
smaller than the uncompressed data".

Compressing debug_frame would be a possible further extension to this
work, but I've left it for now. The hurdle there is alignment sections -
which might require going as far as to refactor
MCAssembler.cpp:writeFragment to handle writing to a byte buffer or an
MCObjectWriter (there's already a virtual call there, so it shouldn't
add substantial compile-time cost) which could in turn involve
refactoring MCAsmBackend::writeNopData to use that same abstraction...
which involves touching all the backends. This would remove the limited
handling of fragment writing seen in
ELFObjectWriter.cpp:getUncompressedData which would be nice - but it's
more invasive.

I did discover that I (perhaps obviously) don't need to handle
relocations when I rewrite the fragments - since the relocations have
already been applied and computed (and stored into
ELFObjectWriter::Relocations) by this stage (necessarily, because we
need to have written any immediate values or assembly-time relocations
into the data already before we compress it, which we have). The test
case doesn't necessarily cover that in detail - I can add more test
coverage if that's preferred.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205990 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 21:53:53 +00:00
..
MCDisassembler Remove forward declaration for Target class - Target is already defined here. 2014-03-27 01:05:49 +00:00
MCParser DebugInfo: Emit relocation to debug_line section when emitting asm for asm 2014-04-01 07:35:52 +00:00
CMakeLists.txt MachO: Add linker-optimisation hint framework to MC. 2014-03-29 07:34:53 +00:00
ELFObjectWriter.cpp Reimplement debug info compression by compressing the whole section, rather than a fragment. 2014-04-10 21:53:53 +00:00
LLVMBuild.txt
MachObjectWriter.cpp MachO: Add linker-optimisation hint framework to MC. 2014-03-29 07:34:53 +00:00
Makefile
MCAsmBackend.cpp Simplify a really complicated check for Arch == X86_64. 2014-03-11 21:22:57 +00:00
MCAsmInfo.cpp MachO: allow each section to have a linker-private symbol 2014-03-29 07:05:06 +00:00
MCAsmInfoCOFF.cpp Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
MCAsmInfoDarwin.cpp MachO: actually set linker-private prefix at MC level. 2014-03-29 07:33:24 +00:00
MCAsmInfoELF.cpp
MCAsmStreamer.cpp DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference 2014-04-01 08:07:52 +00:00
MCAssembler.cpp Revert debug info compression support. 2014-04-10 21:53:47 +00:00
MCAtom.cpp
MCCodeEmitter.cpp
MCCodeGenInfo.cpp
MCContext.cpp Reimplement debug info compression by compressing the whole section, rather than a fragment. 2014-04-10 21:53:53 +00:00
MCDisassembler.cpp [MC] Remove an unused (and broken) variant of the setupForSymbolicDisassembly 2014-03-30 04:27:33 +00:00
MCDwarf.cpp DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference 2014-04-01 08:07:52 +00:00
MCELF.cpp
MCELFObjectTargetWriter.cpp Completely rewrite ELFObjectWriter::RecordRelocation. 2014-03-29 06:26:49 +00:00
MCELFStreamer.cpp Mark alias symbols as microMIPS if necessary. Differential Revision: http://llvm-reviews.chandlerc.com/D3080 2014-03-20 09:44:49 +00:00
MCExpr.cpp ARM64: initial backend import 2014-03-29 10:18:08 +00:00
MCExternalSymbolizer.cpp Update MCSymbolizer and its subclasses' constructors to reflect the fact that 2014-03-27 02:39:01 +00:00
MCFixup.cpp Add llvm_unreachable after fully-covered switches to appease GCC 2014-03-20 07:30:40 +00:00
MCFunction.cpp
MCInst.cpp
MCInstPrinter.cpp
MCInstrAnalysis.cpp
MCLabel.cpp
MCLinkerOptimizationHint.cpp [ARM64][CollectLOH] Add some comments to explain how the LOHs 2014-04-02 01:02:28 +00:00
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp MachO: Add linker-optimisation hint framework to MC. 2014-03-29 07:34:53 +00:00
MCModule.cpp
MCModuleYAML.cpp YAMLIO: Allow scalars to dictate quotation rules 2014-04-10 07:37:33 +00:00
MCNullStreamer.cpp DebugInfo: Improve reuse of file table entries in asm debug info 2014-03-17 01:52:11 +00:00
MCObjectDisassembler.cpp [C++11] Introduce ObjectFile::symbols() to use range-based loops. 2014-03-17 07:28:19 +00:00
MCObjectFileInfo.cpp WinCOFF: Emit common symbols as specified in the COFF spec 2014-04-08 22:33:40 +00:00
MCObjectStreamer.cpp Revert debug info compression support. 2014-04-10 21:53:47 +00:00
MCObjectSymbolizer.cpp Implement getRelocationAddress for MachO and ET_REL elf files. 2014-04-03 23:54:35 +00:00
MCObjectWriter.cpp
MCRegisterInfo.cpp
MCRelocationInfo.cpp
MCSection.cpp
MCSectionCOFF.cpp
MCSectionELF.cpp
MCSectionMachO.cpp MC: Appease the buildbots 2014-03-10 01:04:18 +00:00
MCStreamer.cpp DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference 2014-04-01 08:07:52 +00:00
MCSubtargetInfo.cpp Reverting r199886 (Prevent repetitive warnings for unrecognized processors and features) 2014-01-25 16:56:18 +00:00
MCSymbol.cpp Revert "Add back r203962, r204028 and r204059." 2014-03-19 00:13:43 +00:00
MCSymbolizer.cpp Move MCSymbolizer's constructor into header. It's trivial - there's no need for 2014-03-27 02:42:52 +00:00
MCValue.cpp MC: add a RefKind field to MCValue 2014-03-29 08:22:20 +00:00
MCWin64EH.cpp
SubtargetFeature.cpp Reverting r199886 (Prevent repetitive warnings for unrecognized processors and features) 2014-01-25 16:56:18 +00:00
WinCOFFObjectWriter.cpp WinCOFF: Emit common symbols as specified in the COFF spec 2014-04-08 22:33:40 +00:00
WinCOFFStreamer.cpp WinCOFF: Emit common symbols as specified in the COFF spec 2014-04-08 22:33:40 +00:00