Author: kcc Date: Wed Apr 19 14:57:16 2017 New Revision: 300738 URL: http://llvm.org/viewvc/llvm-project?rev=300738&view=rev Log: [sanitizer-coverage] deprecate some of the stale coverage variants
Modified: cfe/trunk/docs/SanitizerCoverage.rst cfe/trunk/lib/Driver/SanitizerArgs.cpp cfe/trunk/test/Driver/fsanitize-coverage.c Modified: cfe/trunk/docs/SanitizerCoverage.rst URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SanitizerCoverage.rst?rev=300738&r1=300737&r2=300738&view=diff ============================================================================== --- cfe/trunk/docs/SanitizerCoverage.rst (original) +++ cfe/trunk/docs/SanitizerCoverage.rst Wed Apr 19 14:57:16 2017 @@ -202,27 +202,7 @@ edges by introducing new dummy blocks an Bitset ====== -When ``coverage_bitset=1`` run-time flag is given, the coverage will also be -dumped as a bitset (text file with 1 for blocks that have been executed and 0 -for blocks that were not). - -.. code-block:: console - - % clang++ -fsanitize=address -fsanitize-coverage=edge cov.cc - % ASAN_OPTIONS="coverage=1:coverage_bitset=1" ./a.out - main - % ASAN_OPTIONS="coverage=1:coverage_bitset=1" ./a.out 1 - foo - main - % head *bitset* - ==> a.out.38214.bitset-sancov <== - 01101 - ==> a.out.6128.bitset-sancov <== - 11011% - -For a given executable the length of the bitset is always the same (well, -unless dlopen/dlclose come into play), so the bitset coverage can be -easily used for bitset-based corpus distillation. +**coverage_bitset=1 is deprecated, don't use** Caller-callee coverage ====================== @@ -326,8 +306,6 @@ Basic block tracing is currently support Tracing PCs =========== -**Deprecated, don't use** - *Experimental* feature similar to tracing basic blocks, but with a different API. With ``-fsanitize-coverage=trace-pc`` the compiler will insert ``__sanitizer_cov_trace_pc()`` on every edge. Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=300738&r1=300737&r2=300738&view=diff ============================================================================== --- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original) +++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Apr 19 14:57:16 2017 @@ -469,34 +469,12 @@ SanitizerArgs::SanitizerArgs(const ToolC int LegacySanitizeCoverage; if (Arg->getNumValues() == 1 && !StringRef(Arg->getValue(0)) - .getAsInteger(0, LegacySanitizeCoverage) && - LegacySanitizeCoverage >= 0 && LegacySanitizeCoverage <= 4) { - switch (LegacySanitizeCoverage) { - case 0: - CoverageFeatures = 0; - Arg->claim(); - break; - case 1: - D.Diag(diag::warn_drv_deprecated_arg) << Arg->getAsString(Args) - << "-fsanitize-coverage=func"; - CoverageFeatures = CoverageFunc; - break; - case 2: - D.Diag(diag::warn_drv_deprecated_arg) << Arg->getAsString(Args) - << "-fsanitize-coverage=bb"; - CoverageFeatures = CoverageBB; - break; - case 3: - D.Diag(diag::warn_drv_deprecated_arg) << Arg->getAsString(Args) - << "-fsanitize-coverage=edge"; - CoverageFeatures = CoverageEdge; - break; - case 4: + .getAsInteger(0, LegacySanitizeCoverage)) { + CoverageFeatures = 0; + Arg->claim(); + if (LegacySanitizeCoverage != 0) { D.Diag(diag::warn_drv_deprecated_arg) - << Arg->getAsString(Args) - << "-fsanitize-coverage=edge,indirect-calls"; - CoverageFeatures = CoverageEdge | CoverageIndirCall; - break; + << Arg->getAsString(Args) << "-fsanitize-coverage=trace-pc-guard"; } continue; } Modified: cfe/trunk/test/Driver/fsanitize-coverage.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fsanitize-coverage.c?rev=300738&r1=300737&r2=300738&view=diff ============================================================================== --- cfe/trunk/test/Driver/fsanitize-coverage.c (original) +++ cfe/trunk/test/Driver/fsanitize-coverage.c Wed Apr 19 14:57:16 2017 @@ -23,14 +23,7 @@ // CHECK-SANITIZE-COVERAGE-FUNC_INDIR: fsanitize-coverage-indirect-calls // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1 -// CHECK-SANITIZE-COVERAGE-1: warning: argument '-fsanitize-coverage=1' is deprecated, use '-fsanitize-coverage=func' instead -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-2 -// CHECK-SANITIZE-COVERAGE-2: warning: argument '-fsanitize-coverage=2' is deprecated, use '-fsanitize-coverage=bb' instead -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=3 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-3 -// CHECK-SANITIZE-COVERAGE-3: warning: argument '-fsanitize-coverage=3' is deprecated, use '-fsanitize-coverage=edge' instead -// -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=5 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-5 -// CHECK-SANITIZE-COVERAGE-5: error: unsupported argument '5' to option 'fsanitize-coverage=' +// CHECK-SANITIZE-COVERAGE-1: warning: argument '-fsanitize-coverage=1' is deprecated, use '-fsanitize-coverage=trace-pc-guard' instead // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-UNUSED // RUN: %clang -target x86_64-linux-gnu -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits