From 71a35f7e3d6c78f8035f2eb7d58beba3b7208f9d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 17 May 2023 16:09:12 -0700 Subject: [gcov] Simplify cc1 options and remove CodeGenOptions EmitCovNotes/EmitCovArcs After a07b135ce0c0111bd83450b5dc29ef0381cdbc39, we always pass -coverage-notes-file/-coverage-data-file for driver options -ftest-coverage/-fprofile-arcs/--coverage. As a bonus, we can make the following simplification to cc1 options: * `-ftest-coverage -coverage-notes-file a.gcno` => `-coverage-notes-file a.gcno` * `-fprofile-arcs -coverage-data-file a.gcda` => `-coverage-data-file a.gcda` and remove EmitCovNotes/EmitCovArcs. --- clang/lib/Frontend/CompilerInvocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c111607..a1d836f 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1801,7 +1801,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.MemoryProfileOutput = MemProfileBasename; memcpy(Opts.CoverageVersion, "408*", 4); - if (Opts.EmitGcovArcs || Opts.EmitGcovNotes) { + if (Opts.CoverageNotesFile.size() || Opts.CoverageDataFile.size()) { if (Args.hasArg(OPT_coverage_version_EQ)) { StringRef CoverageVersion = Args.getLastArgValue(OPT_coverage_version_EQ); if (CoverageVersion.size() != 4) { -- cgit v1.1