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

ADRA via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 3 19:30:33 PDT 2020


ADRAADRA created this revision.
ADRAADRA added a reviewer: tra.
ADRAADRA added a project: clang.
Herald added subscribers: cfe-commits, yaxunl.

- accept -x cu to indicate language is CUDA
- transfer CUDA language flag to header-file arguments


Repository:
  rG LLVM Github Monorepo

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,10 @@
   case types::TY_ObjCXX:
   case types::TY_ObjCXXHeader:
     return types::TY_ObjCXX;
+  case types::TY_CUDA:
+  case types::TY_CUDA_DEVICE:
+  case types::TY_CUDA_FATBIN:
+    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 -x cu to indicate CUDA
+  if (strcmp(Name, "cu") == 0) {
+    return types::TY_CUDA;
+  }
   return TY_INVALID;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77451.254980.patch
Type: text/x-patch
Size: 905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200404/3e797287/attachment-0001.bin>


More information about the cfe-commits mailing list