[PATCH] D91034: [Frontend] Treat CUDA header files as CUDA source files

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 11:43:12 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe7c7a1982632: [Frontend] Treat .cuh files as CUDA source files (authored by tomilov, committed by MaskRay).
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D91034?vs=304905&id=304916#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91034

Files:
  clang/lib/Frontend/FrontendOptions.cpp
  clang/test/Parser/cuda-check-input-kind-assoc.cuh


Index: clang/test/Parser/cuda-check-input-kind-assoc.cuh
===================================================================
--- /dev/null
+++ clang/test/Parser/cuda-check-input-kind-assoc.cuh
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsyntax-only -Werror %s
+
+// Check input kind association for cuh extension.
+
+__attribute__((host, device)) void hd_fn() {}
Index: clang/lib/Frontend/FrontendOptions.cpp
===================================================================
--- clang/lib/Frontend/FrontendOptions.cpp
+++ clang/lib/Frontend/FrontendOptions.cpp
@@ -29,7 +29,7 @@
       .Case("cppm", Language::CXX)
       .Case("iim", InputKind(Language::CXX).getPreprocessed())
       .Case("cl", Language::OpenCL)
-      .Case("cu", Language::CUDA)
+      .Cases("cu", "cuh", Language::CUDA)
       .Case("hip", Language::HIP)
       .Cases("ll", "bc", Language::LLVM_IR)
       .Default(Language::Unknown);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91034.304916.patch
Type: text/x-patch
Size: 906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201112/f3a453d3/attachment.bin>


More information about the cfe-commits mailing list