Emit DWARF3 call frame information when DWARF3+ debug info is requested
authorOliver Stannard <oliver.stannard@arm.com>
Thu, 19 Jun 2014 15:39:33 +0000 (15:39 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Thu, 19 Jun 2014 15:39:33 +0000 (15:39 +0000)
commitf7693f4c1f80e2ad4f14b4c2876b2ad5c59f39b2
tree2a6422550cbe856f1a40b1cef3350ba150450832
parent4f7ef8c6ef1e33e1eb89f7793d7ed630578b7db7
Emit DWARF3 call frame information when DWARF3+ debug info is requested

Currently, llvm always emits a DWARF CIE with a version of 1, even when emitting
DWARF 3 or 4, which both support CIE version 3. This patch makes it emit the
newer CIE version when we are emitting DWARF 3 or 4. This will not reduce
compatibility, as we already emit other DWARF3/4 features, and is worth doing as
the DWARF3 spec removed some ambiguities in the interpretation of call frame
information.

It also fixes a minor bug where the "return address" field of the CIE was
encoded as a ULEB128, which is only valid when the CIE version is 3. There are
no test changes for this, because (as far as I can tell) none of the platforms
that we test have a return address register with a DWARF register number >127.

llvm-svn: 211272
29 files changed:
llvm/include/llvm/Support/Dwarf.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/MC/MCDwarf.cpp
llvm/test/DebugInfo/AArch64/eh_frame.s
llvm/test/DebugInfo/AArch64/eh_frame_personality.ll
llvm/test/DebugInfo/SystemZ/eh_frame.s
llvm/test/DebugInfo/SystemZ/eh_frame_personality.s
llvm/test/MC/ELF/cfi-adjust-cfa-offset.s
llvm/test/MC/ELF/cfi-advance-loc2.s
llvm/test/MC/ELF/cfi-def-cfa-offset.s
llvm/test/MC/ELF/cfi-def-cfa-register.s
llvm/test/MC/ELF/cfi-def-cfa.s
llvm/test/MC/ELF/cfi-escape.s
llvm/test/MC/ELF/cfi-offset.s
llvm/test/MC/ELF/cfi-register.s
llvm/test/MC/ELF/cfi-rel-offset.s
llvm/test/MC/ELF/cfi-rel-offset2.s
llvm/test/MC/ELF/cfi-remember.s
llvm/test/MC/ELF/cfi-restore.s
llvm/test/MC/ELF/cfi-same-value.s
llvm/test/MC/ELF/cfi-sections.s
llvm/test/MC/ELF/cfi-signal-frame.s
llvm/test/MC/ELF/cfi-undefined.s
llvm/test/MC/ELF/cfi-version.ll [new file with mode: 0644]
llvm/test/MC/ELF/cfi-window-save.s
llvm/test/MC/ELF/cfi-zero-addr-delta.s
llvm/test/MC/ELF/cfi.s
llvm/test/MC/Mips/eh-frame.s
llvm/test/MC/PowerPC/ppc64-initial-cfa.s