]> granicus.if.org Git - clang/commit
[CUDA] Allow function overloads in CUDA based on host/device attributes.
authorArtem Belevich <tra@google.com>
Tue, 22 Sep 2015 17:22:59 +0000 (17:22 +0000)
committerArtem Belevich <tra@google.com>
Tue, 22 Sep 2015 17:22:59 +0000 (17:22 +0000)
commit72de1e381c176b8c130e589d9dcd9ed78bb4c4bc
tree3a15848a031d2bdf782fe0395f0338a3d165328c
parent2ead4d5eabb25334b92746a6eaf51b2285c73709
[CUDA] Allow function overloads in CUDA based on host/device attributes.

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
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.

Differential Revision: http://reviews.llvm.org/D12453

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248295 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/LangOptions.def
include/clang/Driver/CC1Options.td
include/clang/Sema/Sema.h
lib/Frontend/CompilerInvocation.cpp
lib/Sema/SemaCUDA.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaOverload.cpp
test/CodeGenCUDA/function-overload.cu [new file with mode: 0644]
test/SemaCUDA/function-overload.cu [new file with mode: 0644]