[clang] 64473f1 - [gcov] Use Joined = form for -coverage-notes-file and -coverage-data-file
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 15 14:49:07 PDT 2023
Author: Fangrui Song
Date: 2023-08-15T14:49:02-07:00
New Revision: 64473f1221fbc16af140407d5ea64d808f5853a7
URL: https://github.com/llvm/llvm-project/commit/64473f1221fbc16af140407d5ea64d808f5853a7
DIFF: https://github.com/llvm/llvm-project/commit/64473f1221fbc16af140407d5ea64d808f5853a7.diff
LOG: [gcov] Use Joined = form for -coverage-notes-file and -coverage-data-file
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/CodeGen/attr-function-return.c
clang/test/CodeGen/code-coverage-tsan.c
clang/test/CodeGen/code-coverage.c
clang/test/CodeGen/no_profile.c
clang/test/Driver/coverage.c
clang/test/Driver/cuda-no-pgo-or-coverage.cu
clang/test/Driver/working-directory.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index be3c92162f5bf0..6b2b8507061c21 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -929,8 +929,8 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
(void)D.getVFS().makeAbsolute(CoverageFilename);
llvm::sys::path::replace_extension(CoverageFilename, "gcno");
if (EmitCovNotes) {
- CmdArgs.push_back("-coverage-notes-file");
- CmdArgs.push_back(Args.MakeArgString(CoverageFilename));
+ CmdArgs.push_back(
+ Args.MakeArgString("-coverage-notes-file=" + CoverageFilename));
}
if (EmitCovData) {
@@ -940,8 +940,8 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
llvm::sys::path::append(CoverageFilename, Gcno);
}
llvm::sys::path::replace_extension(CoverageFilename, "gcda");
- CmdArgs.push_back("-coverage-data-file");
- CmdArgs.push_back(Args.MakeArgString(CoverageFilename));
+ CmdArgs.push_back(
+ Args.MakeArgString("-coverage-data-file=" + CoverageFilename));
}
}
}
diff --git a/clang/test/CodeGen/attr-function-return.c b/clang/test/CodeGen/attr-function-return.c
index cbb10082651d55..df2cabf28693a3 100644
--- a/clang/test/CodeGen/attr-function-return.c
+++ b/clang/test/CodeGen/attr-function-return.c
@@ -8,7 +8,7 @@
// RUN: -Werror=ignored-attributes -mfunction-return=thunk-extern \
// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-EXTERN
// RUN: %clang_cc1 -std=gnu2x -triple x86_64-linux-gnu %s -emit-llvm -o - \
-// RUN: -mfunction-return=thunk-extern -coverage-data-file /dev/null \
+// RUN: -mfunction-return=thunk-extern -coverage-data-file=/dev/null \
// RUN: | FileCheck %s --check-prefix=CHECK-GCOV
// RUN: %clang_cc1 -std=gnu2x -triple x86_64-linux-gnu %s -emit-llvm -o - \
// RUN: -mfunction-return=thunk-extern -fsanitize=address \
diff --git a/clang/test/CodeGen/code-coverage-tsan.c b/clang/test/CodeGen/code-coverage-tsan.c
index cb37a38bdaf0a7..8b0676dd454626 100644
--- a/clang/test/CodeGen/code-coverage-tsan.c
+++ b/clang/test/CodeGen/code-coverage-tsan.c
@@ -1,7 +1,7 @@
/// -fprofile-update=atomic (implied by -fsanitize=thread) requires the
/// (potentially concurrent) counter updates to be atomic.
// RUN: %clang_cc1 %s -triple x86_64 -emit-llvm -fprofile-update=atomic \
-// RUN: -coverage-notes-file /dev/null -coverage-data-file /dev/null -o - | FileCheck %s
+// RUN: -coverage-notes-file=/dev/null -coverage-data-file=/dev/null -o - | FileCheck %s
// CHECK-LABEL: void @foo()
/// Two counters are incremented by __tsan_atomic64_fetch_add.
diff --git a/clang/test/CodeGen/code-coverage.c b/clang/test/CodeGen/code-coverage.c
index dbb7e1479290b8..af02a6ddaef990 100644
--- a/clang/test/CodeGen/code-coverage.c
+++ b/clang/test/CodeGen/code-coverage.c
@@ -3,11 +3,11 @@
/// 4.7 enables cfg_checksum.
/// 4.8 (default, compatible with gcov 7) emits the exit block the second.
// RUN: rm -rf %t && mkdir %t && cd %t
-// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-data-file /dev/null -coverage-version='304*' %s -o - | \
+// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='304*' %s -o - | \
// RUN: FileCheck --check-prefixes=CHECK,304 %s
-// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-data-file /dev/null -coverage-version='407*' %s -o - | \
+// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-data-file=/dev/null -coverage-version='407*' %s -o - | \
// RUN: FileCheck --check-prefixes=CHECK,407 %s
-// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-data-file /dev/null %s -o - | \
+// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-data-file=/dev/null %s -o - | \
// RUN: FileCheck --check-prefixes=CHECK,408 %s
// RUN: %clang_cc1 -emit-llvm -disable-red-zone -coverage-notes-file=aaa.gcno -coverage-data-file=bbb.gcda -debug-info-kind=limited -dwarf-version=4 %s -o - | FileCheck %s --check-prefix GCOV_FILE_INFO
diff --git a/clang/test/CodeGen/no_profile.c b/clang/test/CodeGen/no_profile.c
index e426ae5fe28947..35816463091f93 100644
--- a/clang/test/CodeGen/no_profile.c
+++ b/clang/test/CodeGen/no_profile.c
@@ -4,7 +4,7 @@
// RUN: -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fprofile-instrument=clang -disable-llvm-passes \
// RUN: -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -coverage-data-file /dev/null -disable-llvm-passes \
+// RUN: %clang_cc1 -coverage-data-file=/dev/null -disable-llvm-passes \
// RUN: -emit-llvm -o - %s | FileCheck %s
int g(int);
diff --git a/clang/test/Driver/coverage.c b/clang/test/Driver/coverage.c
index d77a720f8adebc..e5ed064aab457c 100644
--- a/clang/test/Driver/coverage.c
+++ b/clang/test/Driver/coverage.c
@@ -1,25 +1,25 @@
// RUN: %clang -### -S -ftest-coverage %s 2>&1 | FileCheck --check-prefix=TEST-COVERAGE %s
// RUN: %clang -### -S -ftest-coverage -fno-test-coverage %s 2>&1 | FileCheck --check-prefix=NO-TEST-COVERAGE %s
-// TEST-COVERAGE: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage.gcno"
-// NO-TEST-COVERAGE-NOT: "-coverage-notes-file"
+// TEST-COVERAGE: "-coverage-notes-file={{.*}}{{/|\\\\}}coverage.gcno"
+// NO-TEST-COVERAGE-NOT: "-coverage-notes-file=
// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck --check-prefix=PROFILE-ARCS %s
// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck --check-prefix=NO-PROFILE-ARCS %s
-// NO-PROFILE-ARCS-NOT: "-coverage-notes-file"
-// PROFILE-ARCS: "-coverage-data-file" "{{.*}}{{/|\\\\}}coverage.gcda"
+// NO-PROFILE-ARCS-NOT: "-coverage-notes-file=
+// PROFILE-ARCS: "-coverage-data-file={{.*}}{{/|\\\\}}coverage.gcda"
// RUN: %clang -### -S -ftest-coverage %s -o /foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
// RUN: %clang_cl -### /c --coverage /Fo/foo/bar.obj -- %s 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
// RUN: %clang -### -c -ftest-coverage %s -o foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION-REL %s
-// GCNO-LOCATION: "-coverage-notes-file" "{{.*}}/foo/bar.gcno"
-// GCNO-LOCATION-REL: "-coverage-notes-file" "{{.*}}{{/|\\\\}}foo/bar.gcno"
+// GCNO-LOCATION: "-coverage-notes-file={{.*}}/foo/bar.gcno"
+// GCNO-LOCATION-REL: "-coverage-notes-file={{.*}}{{/|\\\\}}foo/bar.gcno"
/// GCC allows PWD to change the paths.
// RUN: %if system-linux %{ PWD=/proc/self/cwd %clang -### -c --coverage %s -o foo/bar.o 2>&1 | FileCheck --check-prefix=PWD %s %}
-// PWD: "-coverage-notes-file" "/proc/self/cwd/foo/bar.gcno" "-coverage-data-file" "/proc/self/cwd/foo/bar.gcda"
+// PWD: "-coverage-notes-file=/proc/self/cwd/foo/bar.gcno" "-coverage-data-file=/proc/self/cwd/foo/bar.gcda"
/// Don't warn -Wunused-command-line-argument.
// RUN: %clang -E -Werror --coverage -ftest-coverage -fprofile-arcs %s
@@ -30,26 +30,26 @@
// RUN: %clang -### -S -fprofile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
// RUN: %clang -### -S --coverage -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
-// PROFILE-DIR: "-coverage-data-file" "abc
+// PROFILE-DIR: "-coverage-data-file=abc
/// These should only get passed if any of --coverage, -ftest-coverage, or
/// -fprofile-arcs is passed.
// RUN: %clang -### -c %s 2>&1 | FileCheck --check-prefix=NO-COV %s
-// NO-COV-NOT: "-coverage-notes-file"
-// NO-COV-NOT: "-coverage-data-file"
+// NO-COV-NOT: "-coverage-notes-file=
+// NO-COV-NOT: "-coverage-data-file=
// RUN: rm -rf %t && mkdir %t && cd %t
// RUN: mkdir d e f && cp %s d/a.c && touch d/b.c
// RUN: %clang -### --coverage d/a.c d/b.c -o e/x 2>&1 | FileCheck %s --check-prefix=LINK1
-// LINK1: -cc1{{.*}} "-coverage-notes-file" "{{.*}}{{/|\\\\}}e/x-a.gcno" "-coverage-data-file" "{{.*}}{{/|\\\\}}e/x-a.gcda"
-// LINK1: -cc1{{.*}} "-coverage-notes-file" "{{.*}}{{/|\\\\}}e/x-b.gcno" "-coverage-data-file" "{{.*}}{{/|\\\\}}e/x-b.gcda"
+// LINK1: -cc1{{.*}} "-coverage-notes-file={{.*}}{{/|\\\\}}e/x-a.gcno" "-coverage-data-file={{.*}}{{/|\\\\}}e/x-a.gcda"
+// LINK1: -cc1{{.*}} "-coverage-notes-file={{.*}}{{/|\\\\}}e/x-b.gcno" "-coverage-data-file={{.*}}{{/|\\\\}}e/x-b.gcda"
// RUN: %clang -### --coverage d/a.c d/b.c -o e/x -dumpdir f/g 2>&1 | FileCheck %s --check-prefix=LINK2
-// LINK2: -cc1{{.*}} "-coverage-notes-file" "{{.*}}{{/|\\\\}}f/ga.gcno" "-coverage-data-file" "{{.*}}{{/|\\\\}}f/ga.gcda"
-// LINK2: -cc1{{.*}} "-coverage-notes-file" "{{.*}}{{/|\\\\}}f/gb.gcno" "-coverage-data-file" "{{.*}}{{/|\\\\}}f/gb.gcda"
+// LINK2: -cc1{{.*}} "-coverage-notes-file={{.*}}{{/|\\\\}}f/ga.gcno" "-coverage-data-file={{.*}}{{/|\\\\}}f/ga.gcda"
+// LINK2: -cc1{{.*}} "-coverage-notes-file={{.*}}{{/|\\\\}}f/gb.gcno" "-coverage-data-file={{.*}}{{/|\\\\}}f/gb.gcda"
/// GCC allows PWD to change the paths.
// RUN: %if system-linux %{ PWD=/proc/self/cwd %clang -### --coverage d/a.c d/b.c -o e/x -fprofile-dir=f 2>&1 | FileCheck %s --check-prefix=LINK3 %}
-// LINK3: -cc1{{.*}} "-coverage-notes-file" "/proc/self/cwd/e/x-a.gcno" "-coverage-data-file" "f/proc/self/cwd/e/x-a.gcda"
-// LINK3: -cc1{{.*}} "-coverage-notes-file" "/proc/self/cwd/e/x-b.gcno" "-coverage-data-file" "f/proc/self/cwd/e/x-b.gcda"
+// LINK3: -cc1{{.*}} "-coverage-notes-file=/proc/self/cwd/e/x-a.gcno" "-coverage-data-file=f/proc/self/cwd/e/x-a.gcda"
+// LINK3: -cc1{{.*}} "-coverage-notes-file=/proc/self/cwd/e/x-b.gcno" "-coverage-data-file=f/proc/self/cwd/e/x-b.gcda"
diff --git a/clang/test/Driver/cuda-no-pgo-or-coverage.cu b/clang/test/Driver/cuda-no-pgo-or-coverage.cu
index 129b179a38a992..b84587e1e182be 100644
--- a/clang/test/Driver/cuda-no-pgo-or-coverage.cu
+++ b/clang/test/Driver/cuda-no-pgo-or-coverage.cu
@@ -30,4 +30,4 @@
// CHECK-NOT: "-fprofile{{[^"]*}}"
// CHECK: "-triple" "x86_64-unknown-linux-gnu"
// PROF: "-fprofile{{.*}}"
-// GCOV: "-coverage-notes-file"
+// GCOV: "-coverage-notes-file=
diff --git a/clang/test/Driver/working-directory.c b/clang/test/Driver/working-directory.c
index d8fc56854cf290..b6ae5f38c44786 100644
--- a/clang/test/Driver/working-directory.c
+++ b/clang/test/Driver/working-directory.c
@@ -7,5 +7,5 @@
// CHECK_NO_FILE: no such file or directory: 'no_such_file.cpp'
// CHECK_WORKS: "-fdebug-compilation-dir={{[^"]+}}test{{/|\\\\}}Driver{{/|\\\\}}Inputs"
-// CHECK_WORKS: "-coverage-notes-file" "{{[^"]+}}test{{/|\\\\}}Driver{{/|\\\\}}Inputs{{/|\\\\}}pchfile.gcno"
+// CHECK_WORKS: "-coverage-notes-file={{[^"]+}}test{{/|\\\\}}Driver{{/|\\\\}}Inputs{{/|\\\\}}pchfile.gcno"
// CHECK_WORKS: "-working-directory" "{{[^"]+}}test{{/|\\\\}}Driver{{/|\\\\}}Inputs"
More information about the cfe-commits
mailing list