Move the sysroot attribute from DIModule to DICompileUnit
authorAdrian Prantl <aprantl@apple.com>
Tue, 14 Jan 2020 21:37:04 +0000 (13:37 -0800)
committerAdrian Prantl <aprantl@apple.com>
Fri, 17 Jan 2020 20:55:40 +0000 (12:55 -0800)
commit7b30370e5bcf569fcdc15204d4c592163fd78cb3
tree168710fa72ed2995b0069eda59a95465125efc88
parentc17aee67f1007426fb12f4081183bb8ec5dc3d15
Move the sysroot attribute from DIModule to DICompileUnit

[this re-applies c0176916a4824812d25a5a22c4ff7c95857b0cd6
 with the correct commit message and phabricator link]

This addresses point 1 of PR44213.
https://bugs.llvm.org/show_bug.cgi?id=44213

The DW_AT_LLVM_sysroot attribute is used for Clang module debug info,
to allow LLDB to import a Clang module from source. Currently it is
part of each DW_TAG_module, however, it is the same for all modules in
a compile unit. It is more efficient and less ambiguous to store it
once in the DW_TAG_compile_unit.

This should have no effect on DWARF consumers other than LLDB.

Differential Revision: https://reviews.llvm.org/D71732
29 files changed:
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGen/debug-info-sysroot.c [new file with mode: 0644]
clang/test/CodeGen/debug-nvptx.c
clang/test/Modules/debug-info-moduleimport.m
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
llvm/bindings/go/llvm/dibuilder.go
llvm/include/llvm-c/DebugInfo.h
llvm/include/llvm/IR/DIBuilder.h
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/DIBuilder.cpp
llvm/lib/IR/DebugInfo.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/lib/IR/LLVMContextImpl.h
llvm/test/Assembler/dicompileunit.ll
llvm/test/Assembler/dimodule.ll
llvm/test/Bindings/llvm-c/debug_info.ll
llvm/test/CodeGen/X86/load-combine-dbg.ll
llvm/test/DebugInfo/X86/DIModule.ll
llvm/test/DebugInfo/X86/DIModuleContext.ll
llvm/test/DebugInfo/X86/clang-module.ll
llvm/test/DebugInfo/X86/split-dwarf-sysroot.ll [new file with mode: 0644]
llvm/tools/llvm-c-test/debuginfo.c
llvm/unittests/IR/MetadataTest.cpp