[clang] 577d9ce - Revert "[Driver] Escape the program path for -frecord-command-line"
Scott Linder via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 20 14:37:45 PST 2020
Author: Scott Linder
Date: 2020-02-20T17:36:56-05:00
New Revision: 577d9ce35532439203411c999deefc9c80e04c69
URL: https://github.com/llvm/llvm-project/commit/577d9ce35532439203411c999deefc9c80e04c69
DIFF: https://github.com/llvm/llvm-project/commit/577d9ce35532439203411c999deefc9c80e04c69.diff
LOG: Revert "[Driver] Escape the program path for -frecord-command-line"
This reverts commit 6123074d0c0de3614f1552f2f2d6b9db7b32cebe.
Quoting/escaping rules seem host specific, so the test is failing on
some bots.
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/clang_f_opts.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index fc2bb9c60d68..1091db691858 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5882,7 +5882,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Arg->render(Args, OriginalArgs);
SmallString<256> Flags;
- EscapeSpacesAndBackslashes(Exec, Flags);
+ Flags += Exec;
for (const char *OriginalArg : OriginalArgs) {
SmallString<128> EscapedArg;
EscapeSpacesAndBackslashes(OriginalArg, EscapedArg);
@@ -6790,7 +6790,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
SmallString<256> Flags;
const char *Exec = getToolChain().getDriver().getClangProgramPath();
- EscapeSpacesAndBackslashes(Exec, Flags);
+ Flags += Exec;
for (const char *OriginalArg : OriginalArgs) {
SmallString<128> EscapedArg;
EscapeSpacesAndBackslashes(OriginalArg, EscapedArg);
diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c
index ce58467d2156..6fb820a9938d 100644
--- a/clang/test/Driver/clang_f_opts.c
+++ b/clang/test/Driver/clang_f_opts.c
@@ -572,11 +572,6 @@
// CHECK-RECORD-GCC-SWITCHES: "-record-command-line"
// CHECK-NO-RECORD-GCC-SWITCHES-NOT: "-record-command-line"
// CHECK-RECORD-GCC-SWITCHES-ERROR: error: unsupported option '-frecord-command-line' for target
-// Test when clang is in a path containing a space.
-// RUN: mkdir -p "%t.r/with spaces"
-// RUN: cp %clang "%t.r/with spaces/clang"
-// RUN: "%t.r/with spaces/clang" -### -S -target x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ESCAPED %s
-// CHECK-RECORD-GCC-SWITCHES-ESCAPED: "-record-command-line" "{{.+}}/with\\ spaces/clang {{.+}}"
// RUN: %clang -### -S -ftrivial-auto-var-init=uninitialized %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-UNINIT %s
// RUN: %clang -### -S -ftrivial-auto-var-init=pattern %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN %s
More information about the cfe-commits
mailing list