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();


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();
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to