Allow retrieving source files relative to the compilation directory.
authorSterling Augustine <saugustine@google.com>
Fri, 24 Jan 2020 22:36:22 +0000 (14:36 -0800)
committerSterling Augustine <saugustine@google.com>
Tue, 11 Feb 2020 19:46:20 +0000 (11:46 -0800)
commit417375d785b865b21ca4dc6cb6d70f833fb196cc
tree144d90b0ed59670ff65c13427d64817e20773e50
parent9c1a88c96457ffde71f13c74fd4d52a77d86cc9f
Allow retrieving source files relative to the compilation directory.

Summary:
Dwarf stores source-file names the three parts:
<compilation_directory><include_directory><filename>

Prior to this change, the code only allowed retrieving either all
three as the absolute path, or just the filename.  But many
compile-command lines--especially those in hermetic build systems
don't specify an absolute path, nor just the filename, but rather the
path relative to the compilation directory. This features allows
retrieving them in that style.

Add tests for path printing styles.

Modify createBasicPrologue to handle include directories.

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73383
llvm/include/llvm/DebugInfo/DIContext.h
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp