[Driver] Escape the program path for -frecord-command-line
authorScott Linder <Scott.Linder@amd.com>
Thu, 20 Feb 2020 21:31:17 +0000 (16:31 -0500)
committerScott Linder <Scott.Linder@amd.com>
Sat, 22 Feb 2020 00:16:59 +0000 (19:16 -0500)
commit340feac6721e840f88c1e77dd79931eea5eaccf3
tree0b6ff64eac5a7dd6d7e2e9acc2b818150cc010ad
parent42060c0a987076567814f97abdf485a55bf6018a
[Driver] Escape the program path for -frecord-command-line

Similar to the rest of the command line that is recorded, the program
path must also have spaces and backslashes escaped. Without this
parsing the recorded command line becomes hard on platforms like
Windows where spaces and backslashes are common.

This was originally reverted in
577d9ce35532439203411c999deefc9c80e04c69; this version makes a test
agnostic to the presence of backslashes in paths on some platforms.

Patch By: Ravi Ramaseshan
Differential Revision: https://reviews.llvm.org/D74811
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/clang_f_opts.c