]> granicus.if.org Git - clang/commit
Support Debug Info path remapping
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 12 Oct 2015 20:21:08 +0000 (20:21 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 12 Oct 2015 20:21:08 +0000 (20:21 +0000)
commitcc4221bf161ae46738eb71778fedd36e3271ea4c
treeec789639c178c29fe4d6c1101e32a158853d98be
parentef378def97da93bae9e3e76eead6f81b3bfb1806
Support Debug Info path remapping

Add support for the `-fdebug-prefix-map=` option as in GCC.  The syntax is
`-fdebug-prefix-map=OLD=NEW`.  When compiling files from a path beginning with
OLD, change the debug info to indicate the path as start with NEW.  This is
particularly helpful if you are preprocessing in one path and compiling in
another (e.g. for a build cluster with distcc).

Note that the linearity of the implementation is not as terrible as it may seem.
This is normally done once per file with an expectation that the map will be
small (1-2) entries, making this roughly linear in the number of input paths.

Addresses PR24619.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250094 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticDriverKinds.td
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.h
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/debug-prefix-map.c [new file with mode: 0644]
test/Driver/debug-prefix-map.c [new file with mode: 0644]