r251598 - Driver: tweak CrossWindows sanitizer support
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 28 20:36:39 PDT 2015
Author: compnerd
Date: Wed Oct 28 22:36:38 2015
New Revision: 251598
URL: http://llvm.org/viewvc/llvm-project?rev=251598&view=rev
Log:
Driver: tweak CrossWindows sanitizer support
Indicate support for ASAN on the CrossWindows toolchain. Although this is
insufficient, this at least permits the handling of the driver flag.
Modified:
cfe/trunk/lib/Driver/CrossWindowsToolChain.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/test/Driver/windows-cross.c
Modified: cfe/trunk/lib/Driver/CrossWindowsToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CrossWindowsToolChain.cpp?rev=251598&r1=251597&r2=251598&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/CrossWindowsToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/CrossWindowsToolChain.cpp Wed Oct 28 22:36:38 2015
@@ -107,6 +107,12 @@ AddCXXStdlibLibArgs(const llvm::opt::Arg
}
}
+clang::SanitizerMask CrossWindowsToolChain::getSupportedSanitizers() const {
+ SanitizerMask Res = ToolChain::getSupportedSanitizers();
+ Res |= SanitizerKind::Address;
+ return Res;
+}
+
Tool *CrossWindowsToolChain::buildLinker() const {
return new tools::CrossWindows::Linker(*this);
}
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=251598&r1=251597&r2=251598&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Wed Oct 28 22:36:38 2015
@@ -937,6 +937,8 @@ public:
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
+ SanitizerMask getSupportedSanitizers() const override;
+
protected:
Tool *buildLinker() const override;
Tool *buildAssembler() const override;
Modified: cfe/trunk/test/Driver/windows-cross.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/windows-cross.c?rev=251598&r1=251597&r2=251598&view=diff
==============================================================================
--- cfe/trunk/test/Driver/windows-cross.c (original)
+++ cfe/trunk/test/Driver/windows-cross.c Wed Oct 28 22:36:38 2015
@@ -40,5 +40,17 @@
// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -x c++ %s 2>&1 \
// RUN: | FileCheck %s --check-prefix CHECK-FUSE-LD
+
// CHECK-FUSE-LD: "{{.*}}lld-link2"
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -fsanitize=address -x c++ %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-ADDRESS
+
+// CHECK-SANITIZE-ADDRESS: "-fsanitize=address"
+
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -fsanitize=tsan -x c++ %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-TSAN
+
+// CHECK-SANITIZE-TSAN: clang-3.8: error: unsupported argument 'tsan' to option 'fsanitize='
+// CHECK-SANITIZE-TSAN-NOT: "-fsanitize={{.*}}"
+
More information about the cfe-commits
mailing list