[PATCH] D12453: [CUDA] Allow function overloads based on host/device attributes.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 15:52:33 PDT 2015


tra created this revision.
tra added reviewers: eliben, rsmith, jholewinski, echristo, jingyue.
tra added a subscriber: cfe-commits.

The patch makes it possible to parse CUDA files that contain host/device functions with identical signatures, but different attributes  without having to physically split source into host-only and device-only parts.

This change is needed in order to parse CUDA header files that have a lot of name clashes with standard include files.

Gory details are in design doc here: [[ https://goo.gl/EXnymm | https://goo.gl/EXnymm ]]
Feel free to leave comments there or in this review thread.

This feature is controlled with CC1 option -fcuda-target-overloads and is disabled by default.

Includes the changes to add appropriate host/device attribute to target-specific builtins that were reviewed in http://reviews.llvm.org/D12122

http://reviews.llvm.org/D12453

Files:
  include/clang/Basic/Builtins.h
  include/clang/Basic/LangOptions.def
  include/clang/Driver/CC1Options.td
  include/clang/Sema/Sema.h
  lib/AST/ItaniumMangle.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Sema/SemaCUDA.cpp
  lib/Sema/SemaChecking.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaOverload.cpp
  test/CodeGenCUDA/function-overload.cu
  test/SemaCUDA/builtins.cu
  test/SemaCUDA/function-overload.cu
  test/SemaCUDA/implicit-intrinsic.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12453.33483.patch
Type: text/x-patch
Size: 28096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150828/1a4ea184/attachment-0001.bin>


More information about the cfe-commits mailing list