[all-commits] [llvm/llvm-project] aba5b9: Re-land [CodeView] Add full repro to LF_BUILDINFO ...

Alexandre Ganea via All-commits all-commits at lists.llvm.org
Wed Jan 19 16:44:54 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aba5b91b699c556da0ee04418321b581bd33611e
      https://github.com/llvm/llvm-project/commit/aba5b91b699c556da0ee04418321b581bd33611e
  Author: Alexandre Ganea <alexandre.ganea at legionlabs.com>
  Date:   2022-01-19 (Wed, 19 Jan 2022)

  Changed paths:
    M clang/cmake/caches/BaremetalARM.cmake
    M clang/cmake/caches/CrossWinToARMLinux.cmake
    M clang/cmake/caches/Fuchsia-stage2.cmake
    A clang/test/CodeGen/debug-info-codeview-buildinfo.c
    M lld/test/COFF/Inputs/pdb_lines_1_relative.yaml
    M lld/test/COFF/Inputs/pdb_lines_2_relative.yaml
    M lld/test/COFF/pdb-relative-source-lines.test
    M llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
    M llvm/test/DebugInfo/COFF/build-info.ll
    M llvm/test/DebugInfo/COFF/global-type-hashes.ll
    M llvm/test/DebugInfo/COFF/types-basic.ll
    M llvm/test/DebugInfo/COFF/types-data-members.ll

  Log Message:
  -----------
  Re-land [CodeView] Add full repro to LF_BUILDINFO record

This patch writes the full -cc1 command into the resulting .OBJ, like MSVC does. This allows for external tools (Recode, Live++) to rebuild a source file without any external dependency but the .OBJ itself (other than the compiler) and without knowledge of the build system.

The LF_BUILDINFO record stores a full path to the compiler, the PWD (CWD at program startup), a relative or absolute path to the source, and the full CC1 command line. The stored command line is self-standing (does not depend on the environment). In the same way, MSVC doesn't exactly store the provided command-line, but an expanded version (a somehow equivalent of CC1) which is also self-standing.

For more information see PR36198 and D43002.

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




More information about the All-commits mailing list