[PDB] Add PDBSourcePath flag to support absolutize source file path
authorTakuto Ikuta <takuto.ikuta@gmail.com>
Thu, 19 Jul 2018 04:56:22 +0000 (04:56 +0000)
committerTakuto Ikuta <takuto.ikuta@gmail.com>
Thu, 19 Jul 2018 04:56:22 +0000 (04:56 +0000)
commitd855928ec37e26e98813046d2eb8062ab18cc40c
tree4a563582f84be97d035918f04f8c1c45170f5e1b
parentc35e4bf7ebd2844740bb28f3273742295e61b0a5
[PDB] Add PDBSourcePath flag to support absolutize source file path

This patch changes relative path for source files in obj files to
absolute path in PDB when linking with added flag.

I will make obj file generated by clang-cl independent from build
directory for chromium build. But I don't want to confuse visual studio
debugger or require additional configuration. To attain this goal, I
added flag to convert relative source file path in obj to absolute path
when emitting PDB.

By removing absolute path from obj files, we can share build cache
between chromium developers even when they are doing debug build.
That will make build time faster.

More context:
https://bugs.chromium.org/p/chromium/issues/detail?id=712796
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/5HXSVX-7fPc

llvm-svn: 337439
lld/COFF/Config.h
lld/COFF/Driver.cpp
lld/COFF/Options.td
lld/COFF/PDB.cpp
lld/test/COFF/Inputs/pdb_lines_1_relative.yaml [new file with mode: 0644]
lld/test/COFF/Inputs/pdb_lines_2_relative.yaml [new file with mode: 0644]
lld/test/COFF/pdb-relative-source-lines.test [new file with mode: 0644]