[CrashReproducer] Rewrite relative include paths
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 9 Dec 2016 02:22:47 +0000 (02:22 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 9 Dec 2016 02:22:47 +0000 (02:22 +0000)
commite3a0aef2cf93c7dc144c52798aa5546dc5ec304b
tree7556d541434f7d64902f2adcc3b79d7739fc4617
parent2aeb4564257e16617d718c91550ee28854fd37ce
[CrashReproducer] Rewrite relative include paths

When -fmodules is on, the reproducer invocation currently leave paths
for include-like flags as is. If the path is relative, the reproducer
doesn't know how to access that file during reproduction time because
the VFS cannot reason about relative paths.

Expand relative paths to absolute ones when creating the reproducer
command line. This allows, for example, the reproducer to work for
crashes while building clang with modules; this wasn't possible before
because building clang requires using relative inc dir from within the
build directory.

rdar://problem/28655070

llvm-svn: 289174
clang/lib/Driver/Job.cpp
clang/test/Modules/crash-vfs-relative-incdir.m [new file with mode: 0644]