Thanks!

On Wed, May 3, 2017 at 9:15 AM, Reid Kleckner <r...@google.com> wrote:

> This broke a WinASan test that builds with -Werror:
> http://lab.llvm.org:8011/builders/sanitizer-windows/builds/10647
>
> I tried to fix it in r302043, but I haven't finished testing it yet.
>
> On Tue, May 2, 2017 at 6:27 PM, Kostya Serebryany via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: kcc
>> Date: Tue May  2 20:27:28 2017
>> New Revision: 301994
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=301994&view=rev
>> Log:
>> [sanitizer-coverage] add a deprecation warning to the old
>> sanitizer-coverage flag combinations
>>
>> Modified:
>>     cfe/trunk/lib/Driver/SanitizerArgs.cpp
>>     cfe/trunk/test/Driver/fsanitize-coverage.c
>>
>> Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/San
>> itizerArgs.cpp?rev=301994&r1=301993&r2=301994&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
>> +++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Tue May  2 20:27:28 2017
>> @@ -511,7 +511,6 @@ SanitizerArgs::SanitizerArgs(const ToolC
>>          << "-fsanitize-coverage=edge";
>>    // Basic block tracing and 8-bit counters require some type of coverage
>>    // enabled.
>> -  int CoverageTypes = CoverageFunc | CoverageBB | CoverageEdge;
>>    if (CoverageFeatures & CoverageTraceBB)
>>      D.Diag(clang::diag::warn_drv_deprecated_arg)
>>          << "-fsanitize-coverage=trace-bb"
>> @@ -520,9 +519,18 @@ SanitizerArgs::SanitizerArgs(const ToolC
>>      D.Diag(clang::diag::warn_drv_deprecated_arg)
>>          << "-fsanitize-coverage=8bit-counters"
>>          << "-fsanitize-coverage=trace-pc-guard";
>> +
>> +  int InsertionPointTypes = CoverageFunc | CoverageBB | CoverageEdge;
>> +  if ((CoverageFeatures & InsertionPointTypes) &&
>> +      !(CoverageFeatures &(CoverageTracePC | CoverageTracePCGuard))) {
>> +    D.Diag(clang::diag::warn_drv_deprecated_arg)
>> +        << "-fsanitize-coverage=[func|bb|edge]"
>> +        << "-fsanitize-coverage=[func|bb|edge],[trace-pc-guard|trace-pc
>> ]";
>> +  }
>> +
>>    // trace-pc w/o func/bb/edge implies edge.
>>    if ((CoverageFeatures & (CoverageTracePC | CoverageTracePCGuard)) &&
>> -      !(CoverageFeatures & CoverageTypes))
>> +      !(CoverageFeatures & InsertionPointTypes))
>>      CoverageFeatures |= CoverageEdge;
>>
>>    if (AllAddedKinds & Address) {
>>
>> Modified: cfe/trunk/test/Driver/fsanitize-coverage.c
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fs
>> anitize-coverage.c?rev=301994&r1=301993&r2=301994&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/test/Driver/fsanitize-coverage.c (original)
>> +++ cfe/trunk/test/Driver/fsanitize-coverage.c Tue May  2 20:27:28 2017
>> @@ -4,12 +4,13 @@
>>  // CHECK-SANITIZE-COVERAGE-0-NOT: fsanitize-coverage-type
>>  // CHECK-SANITIZE-COVERAGE-0: -fsanitize=address
>>
>> -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory
>> -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> -// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak
>> -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined
>> -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> -// RUN: %clang -target x86_64-linux-gnu -fsanitize=bool
>> -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> -// RUN: %clang -target x86_64-linux-gnu -fsanitize=dataflow
>> -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory
>> -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak
>> -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined
>> -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=bool
>> -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=dataflow
>> -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>> +// RUN: %clang -target x86_64-linux-gnu
>>  -fsanitize-coverage=func,trace-pc %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-FUNC
>>  // CHECK-SANITIZE-COVERAGE-FUNC: fsanitize-coverage-type=1
>>
>>  // RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=bb %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-BB
>> @@ -25,13 +26,10 @@
>>  // 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=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
>> -// CHECK-SANITIZE-COVERAGE-UNUSED: argument unused during compilation:
>> '-fsanitize-coverage=func'
>> -// CHECK-SANITIZE-COVERAGE-UNUSED-NOT: -fsanitize-coverage-type=1
>> -
>> -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=func -fno-sanitize=address %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK-SANITIZE-COVERAGE-SAN-DISABLED
>> -// CHECK-SANITIZE-COVERAGE-SAN-DISABLED-NOT: argument unused
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=func %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK_FUNC_BB_EDGE_DEPRECATED
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=bb %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK_FUNC_BB_EDGE_DEPRECATED
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=edge %s -### 2>&1 | FileCheck %s
>> --check-prefix=CHECK_FUNC_BB_EDGE_DEPRECATED
>> +// CHECK_FUNC_BB_EDGE_DEPRECATED: warning: argument
>> '-fsanitize-coverage=[func|bb|edge]' is deprecated, use
>> '-fsanitize-coverage=[func|bb|edge],[trace-pc-guard|trace-pc]' instead
>>
>>  // RUN: %clang -target x86_64-linux-gnu -fsanitize=address
>> -fsanitize-coverage=edge,indirect-calls,trace-pc,trace-cmp,trace-div,trace-gep
>> %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-
>> COVERAGE-FEATURES
>>  // CHECK-SANITIZE-COVERAGE-FEATURES: -fsanitize-coverage-type=3
>> @@ -82,7 +80,7 @@
>>  // CHECK-EXTEND-LEGACY: -fsanitize-coverage-type=1
>>  // CHECK-EXTEND-LEGACY: -fsanitize-coverage-trace-cmp
>>
>> -// RUN: %clang_cl --target=i386-pc-win32 -fsanitize=address
>> -fsanitize-coverage=func -c -### -- %s 2>&1 | FileCheck %s
>> -check-prefix=CLANG-CL-COVERAGE
>> +// RUN: %clang_cl --target=i386-pc-win32 -fsanitize=address
>> -fsanitize-coverage=func,trace-pc-guard -c -### -- %s 2>&1 | FileCheck
>> %s -check-prefix=CLANG-CL-COVERAGE
>>  // CLANG-CL-COVERAGE-NOT: error:
>>  // CLANG-CL-COVERAGE-NOT: warning:
>>  // CLANG-CL-COVERAGE-NOT: argument unused
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to