]> granicus.if.org Git - clang/commit
[CUDA] "Support" ASAN arguments in CudaToolChain
authorJason Henline <jhen@google.com>
Fri, 2 Dec 2016 01:42:54 +0000 (01:42 +0000)
committerJason Henline <jhen@google.com>
Fri, 2 Dec 2016 01:42:54 +0000 (01:42 +0000)
commitad22c750d0dfa1a0fcdec84aaac3396a9a5a002a
tree9e3ce836ef5e2eb91c777381047b72a9cb31301a
parent070f9f11c2d556f7657474779c969c9461f9302f
[CUDA] "Support" ASAN arguments in CudaToolChain

This fixes a bug that was introduced in rL287285. The bug made it
illegal to pass -fsanitize=address during CUDA compilation because the
CudaToolChain class was switched from deriving from the Linux toolchain
class to deriving directly from the ToolChain toolchain class. When
CudaToolChain derived from Linux, it used Linux's getSupportedSanitizers
method, and that method allowed ASAN, but when it switched to deriving
directly from ToolChain, it inherited a getSupportedSanitizers method
that didn't allow for ASAN.

This patch fixes that bug by creating a getSupportedSanitizers method
for CudaToolChain that supports ASAN.

This patch also fixes the test that checks that -fsanitize=address is
passed correctly for CUDA builds. That test didn't used to notice if an
error message was emitted, and that's why it didn't catch this bug when
it was first introduced. With the fix from this patch, that test will
now catch any similar bug in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288448 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
test/Driver/cuda-no-sanitizers.cu