[PATCH] D27316: [CUDA] Filter out dirver sanitizer args for NVPTX

Jason Henline via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 1 11:57:46 PST 2016


jhen created this revision.
jhen added a reviewer: jlebar.
jhen added a subscriber: cfe-commits.

This adds to the work from https://reviews.llvm.org/rL281680. This patch
takes care of another execution path in which sanitizer arguments can be
considered for NVPTX because they are used for the corresponding host
code.


https://reviews.llvm.org/D27316

Files:
  lib/Driver/SanitizerArgs.cpp


Index: lib/Driver/SanitizerArgs.cpp
===================================================================
--- lib/Driver/SanitizerArgs.cpp
+++ lib/Driver/SanitizerArgs.cpp
@@ -206,6 +206,12 @@
 
   for (ArgList::const_reverse_iterator I = Args.rbegin(), E = Args.rend();
        I != E; ++I) {
+    // NVPTX doesn't currently support sanitizers, but sanitizer arguments can
+    // still appear on the command line for host code. This means that we must
+    // explicitly ignore sanitizer flags here for device code compilation.
+    if (TC.getTriple().isNVPTX()) {
+      break;
+    }
     const auto *Arg = *I;
     if (Arg->getOption().matches(options::OPT_fsanitize_EQ)) {
       Arg->claim();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27316.79963.patch
Type: text/x-patch
Size: 698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161201/ee21d4d5/attachment-0001.bin>


More information about the cfe-commits mailing list