Author: Fangrui Song Date: 2020-10-19T21:48:51-07:00 New Revision: 0ab222e7d730bb1f8b676e64b51615624e08614b
URL: https://github.com/llvm/llvm-project/commit/0ab222e7d730bb1f8b676e64b51615624e08614b DIFF: https://github.com/llvm/llvm-project/commit/0ab222e7d730bb1f8b676e64b51615624e08614b.diff LOG: [gcov] Delete CC1 option -test-coverage The name is unfortunate because it is similar to the driver option -ftest-coverage. It turns out aside from one occurrence in a test, this option is not used. Added: Modified: clang/include/clang/Basic/CodeGenOptions.def clang/include/clang/Driver/Options.td clang/lib/CodeGen/BackendUtil.cpp clang/lib/Frontend/CompilerInvocation.cpp Removed: clang/test/CodeGenCXX/coverage.cpp ################################################################################ diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def index bce2120a4d6d..641b99edaed1 100644 --- a/clang/include/clang/Basic/CodeGenOptions.def +++ b/clang/include/clang/Basic/CodeGenOptions.def @@ -53,7 +53,6 @@ ENUM_CODEGENOPT(FramePointer, FramePointerKind, 2, FramePointerKind::None) /// f CODEGENOPT(DisableFree , 1, 0) ///< Don't free memory. CODEGENOPT(DiscardValueNames , 1, 0) ///< Discard Value Names from the IR (LLVMContext flag) -CODEGENOPT(DisableGCov , 1, 0) ///< Don't run the GCov pass, for testing. CODEGENOPT(DisableLLVMPasses , 1, 0) ///< Don't run any LLVM IR passes to get ///< the pristine IR generated by the ///< frontend. diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 278e306c23d8..12e0b2a9c302 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3805,8 +3805,6 @@ def coverage_notes_file_EQ : Joined<["-"], "coverage-notes-file=">, Alias<coverage_notes_file>; def coverage_version_EQ : Joined<["-"], "coverage-version=">, HelpText<"Four-byte version string for gcov files.">; -def test_coverage : Flag<["-"], "test-coverage">, - HelpText<"Do not generate coverage files or remove coverage changes from IR">; def dump_coverage_mapping : Flag<["-"], "dump-coverage-mapping">, HelpText<"Dump the coverage mapping records, for testing">; def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">, diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 2a75bd065557..b409773c1521 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -558,8 +558,6 @@ static void initTargetOptions(DiagnosticsEngine &Diags, static Optional<GCOVOptions> getGCOVOptions(const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts) { - if (CodeGenOpts.DisableGCov) - return None; if (!CodeGenOpts.EmitGcovArcs && !CodeGenOpts.EmitGcovNotes) return None; // Not using 'GCOVOptions::getDefault' allows us to avoid exiting if diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 7cbd5b310dd3..80f2d435d4fa 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1052,7 +1052,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.ControlFlowGuardNoChecks = Args.hasArg(OPT_cfguard_no_checks); Opts.ControlFlowGuard = Args.hasArg(OPT_cfguard); - Opts.DisableGCov = Args.hasArg(OPT_test_coverage); Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data); Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes); if (Opts.EmitGcovArcs || Opts.EmitGcovNotes) { diff --git a/clang/test/CodeGenCXX/coverage.cpp b/clang/test/CodeGenCXX/coverage.cpp deleted file mode 100644 index 4b23324afaff..000000000000 --- a/clang/test/CodeGenCXX/coverage.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - -test-coverage -femit-coverage-notes | FileCheck %s - -extern "C" void test_name1() {} -void test_name2() {} - -// CHECK: !DISubprogram(name: "test_name1", -// CHECK-NOT: linkageName: -// CHECK-SAME: ){{$}} -// CHECK: !DISubprogram(name: "test_name2", linkageName: "_Z10test_name2v" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits