OSDN Git Service

[DebugInfo] Support DWARF v5 source code embedding extension
authorScott Linder <scott@scottlinder.com>
Fri, 23 Feb 2018 23:01:06 +0000 (23:01 +0000)
committerScott Linder <scott@scottlinder.com>
Fri, 23 Feb 2018 23:01:06 +0000 (23:01 +0000)
commit5e4b515c4bb332df9c3a063e888f9124a1cd0965
treea0d87835c338da5ffc054324ff431e31fa4351ce
parentf021d3eee1afac9bcdd253b2d475465426c2670e
[DebugInfo] Support DWARF v5 source code embedding extension

In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. In this extension a content type is added,
DW_LNCT_LLVM_source, which contains the embedded source code of the file.

Add new optional attribute for !DIFile IR metadata called source which contains
source text. Use this to output the source to the DWARF line table of code
objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM
to support optional source.

Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output
format of llvm-dwarfdump to make room for the new attribute on file_names
entries, and support embedded sources for the -source option in llvm-objdump.

Differential Revision: https://reviews.llvm.org/D42765

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325970 91177308-0d34-0410-b5e6-96231b3b80d8
51 files changed:
docs/AMDGPUUsage.rst
include/llvm/BinaryFormat/Dwarf.def
include/llvm/DebugInfo/DIContext.h
include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
include/llvm/IR/DIBuilder.h
include/llvm/IR/DebugInfoMetadata.h
include/llvm/MC/MCContext.h
include/llvm/MC/MCDwarf.h
include/llvm/MC/MCStreamer.h
lib/AsmParser/LLParser.cpp
lib/Bitcode/Reader/MetadataLoader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/DebugInfo/DWARF/DWARFContext.cpp
lib/DebugInfo/DWARF/DWARFDebugLine.cpp
lib/IR/AsmWriter.cpp
lib/IR/DIBuilder.cpp
lib/IR/DebugInfoMetadata.cpp
lib/IR/LLVMContextImpl.h
lib/MC/MCAsmStreamer.cpp
lib/MC/MCContext.cpp
lib/MC/MCDwarf.cpp
lib/MC/MCParser/AsmParser.cpp
lib/MC/MCStreamer.cpp
test/Assembler/debug-info.ll
test/CodeGen/BPF/dwarfdump.ll
test/CodeGen/Generic/dwarf-md5.ll
test/CodeGen/X86/dwarf-comp-dir.ll
test/DebugInfo/AMDGPU/dwarfdump-relocs.ll
test/DebugInfo/Generic/lto-comp-dir.ll
test/DebugInfo/X86/debug-macro.ll
test/DebugInfo/X86/dwarfdump-header-64.s
test/DebugInfo/X86/dwarfdump-header.s
test/DebugInfo/X86/dwarfdump-line-dwo.s
test/DebugInfo/X86/dwarfdump-line-only.s
test/DebugInfo/X86/generate-odr-hash.ll
test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
test/DebugInfo/debugmacinfo.test
test/Linker/subprogram-linkonce-weak.ll
test/MC/ARM/dwarf-asm-multiple-sections.s
test/MC/ELF/debug-md5.s
test/MC/MachO/gen-dwarf-cpp.s
test/MC/MachO/gen-dwarf-macro-cpp.s
test/MC/MachO/gen-dwarf.s
test/tools/dsymutil/X86/basic-linking-x86.test
test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
test/tools/dsymutil/X86/basic-lto-linking-x86.test
tools/llvm-objdump/llvm-objdump.cpp
unittests/IR/MetadataTest.cpp