rgreenblatt created this revision.
Herald added a subscriber: yaxunl.
rgreenblatt requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This adds a cuda header type with file extension "cuh". The output type file
extension is "cuhi" - not sure if this is a good choice. This allows
language servers to properly handle cuh files without additional arguments.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94337

Files:
  clang/include/clang/Driver/Types.def
  clang/lib/Driver/Types.cpp


Index: clang/lib/Driver/Types.cpp
===================================================================
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -198,6 +198,8 @@
 
   case TY_CUDA:
   case TY_PP_CUDA:
+  case TY_CUDAHeader:
+  case TY_PP_CUDAHeader:
   case TY_CUDA_DEVICE:
     return true;
   }
Index: clang/include/clang/Driver/Types.def
===================================================================
--- clang/include/clang/Driver/Types.def
+++ clang/include/clang/Driver/Types.def
@@ -64,6 +64,8 @@
 TYPE("c++-header",               CXXHeader,    PP_CXXHeader,    "hh",     
phases::Preprocess, phases::Precompile)
 TYPE("objective-c++-header-cpp-output", PP_ObjCXXHeader, INVALID, "mii",  
phases::Precompile)
 TYPE("objective-c++-header",     ObjCXXHeader, PP_ObjCXXHeader, "h",      
phases::Preprocess, phases::Precompile)
+TYPE("cuda-header-cpp-output",   PP_CUDAHeader, INVALID,        "cuhi",   
phases::Precompile)
+TYPE("cuda-header",              CUDAHeader,   PP_CUDAHeader,   "cuh",    
phases::Preprocess, phases::Precompile)
 TYPE("c++-module",               CXXModule,    PP_CXXModule,    "cppm",   
phases::Preprocess, phases::Precompile, phases::Compile, phases::Backend, 
phases::Assemble, phases::Link)
 TYPE("c++-module-cpp-output",    PP_CXXModule, INVALID,         "iim",    
phases::Precompile, phases::Compile, phases::Backend, phases::Assemble, 
phases::Link)
 


Index: clang/lib/Driver/Types.cpp
===================================================================
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -198,6 +198,8 @@
 
   case TY_CUDA:
   case TY_PP_CUDA:
+  case TY_CUDAHeader:
+  case TY_PP_CUDAHeader:
   case TY_CUDA_DEVICE:
     return true;
   }
Index: clang/include/clang/Driver/Types.def
===================================================================
--- clang/include/clang/Driver/Types.def
+++ clang/include/clang/Driver/Types.def
@@ -64,6 +64,8 @@
 TYPE("c++-header",               CXXHeader,    PP_CXXHeader,    "hh",     phases::Preprocess, phases::Precompile)
 TYPE("objective-c++-header-cpp-output", PP_ObjCXXHeader, INVALID, "mii",  phases::Precompile)
 TYPE("objective-c++-header",     ObjCXXHeader, PP_ObjCXXHeader, "h",      phases::Preprocess, phases::Precompile)
+TYPE("cuda-header-cpp-output",   PP_CUDAHeader, INVALID,        "cuhi",   phases::Precompile)
+TYPE("cuda-header",              CUDAHeader,   PP_CUDAHeader,   "cuh",    phases::Preprocess, phases::Precompile)
 TYPE("c++-module",               CXXModule,    PP_CXXModule,    "cppm",   phases::Preprocess, phases::Precompile, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
 TYPE("c++-module-cpp-output",    PP_CXXModule, INVALID,         "iim",    phases::Precompile, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to