[PATCH] D77451: Accept -x cu to indicate language is CUDA, transfer CUDA language flag to header-file arguments

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 13:17:06 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG6ed88afd780c: [CUDA] Accept -x cu to indicate language is CUDA, transfer CUDA language flag… (authored by ADRAADRA, committed by tra).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77451/new/

https://reviews.llvm.org/D77451

Files:
  clang/lib/Driver/Types.cpp
  clang/lib/Tooling/InterpolatingCompilationDatabase.cpp


Index: clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
===================================================================
--- clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
+++ clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
@@ -114,6 +114,9 @@
   case types::TY_ObjCXX:
   case types::TY_ObjCXXHeader:
     return types::TY_ObjCXX;
+  case types::TY_CUDA:
+  case types::TY_CUDA_DEVICE:
+    return types::TY_CUDA:
   default:
     return types::TY_INVALID;
   }
Index: clang/lib/Driver/Types.cpp
===================================================================
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -295,7 +295,10 @@
         strcmp(Name, getInfo(Id).Name) == 0)
       return Id;
   }
-
+  // Accept "cu" as an alias for "cuda" for NVCC compatibility
+  if (strcmp(Name, "cu") == 0) {
+    return types::TY_CUDA;
+  }
   return TY_INVALID;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77451.256383.patch
Type: text/x-patch
Size: 901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200409/7aaf6221/attachment.bin>


More information about the cfe-commits mailing list