Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Mon, 10 Aug 2020 17:36:20 +0000 (13:36 -0400)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Mon, 10 Aug 2020 17:36:30 +0000 (13:36 -0400)
commita3036b386383f1c1e9d32c2c8dba995087959da3
tree0b49792aaebbf369109be34c9f4e1427054f6140
parent96dfc783b2bf2eca9b01c6b2161a375cc3ea704d
Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record

This patch adds the missing information to the LF_BUILDINFO record, which allows for rebuilding a .CPP without any external dependency but the .OBJ itself (other than the compiler).

Some external tools that we are using (Recode, Live++) are extracting the information to reproduce a build without any knowledge of the build system. The LF_BUILDINFO stores a full path to the compiler, the PWD (CWD at program startup), a relative or absolute path to the TU, and the full CC1 command line. The command line needs to be freestanding (not depend on any environment variables). In the same way, MSVC doesn't store the provided command-line, but an expanded version (somehow their equivalent of CC1) which is also freestanding.

For more information see PR36198 and D43002.

Differential Revision: https://reviews.llvm.org/D80833
15 files changed:
clang/cmake/caches/BaremetalARM.cmake
clang/cmake/caches/CrossWinToARMLinux.cmake
clang/cmake/caches/Fuchsia-stage2.cmake
clang/test/CMakeLists.txt
clang/test/CodeGen/debug-info-codeview-buildinfo.c [new file with mode: 0644]
lld/COFF/PDB.cpp
lld/test/COFF/Inputs/pdb_lines_1_relative.yaml
lld/test/COFF/Inputs/pdb_lines_2_relative.yaml
lld/test/COFF/pdb-relative-source-lines.test
lld/test/COFF/pdb-relative-source-lines2.test [new file with mode: 0644]
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/test/DebugInfo/COFF/build-info.ll
llvm/test/DebugInfo/COFF/global-type-hashes.ll
llvm/test/DebugInfo/COFF/types-basic.ll
llvm/test/DebugInfo/COFF/types-data-members.ll