diff options
author | Artem Belevich <tra@google.com> | 2015-09-22 17:22:59 +0000 |
---|---|---|
committer | Artem Belevich <tra@google.com> | 2015-09-22 17:22:59 +0000 |
commit | 94a55e8169a1e82a2cf954e0495a899cfddee1ac (patch) | |
tree | bba03a45a4e331114ae3a5ee7a85db612369823b /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 81616a72ea53175f23931b34a1372c7cafb80736 (diff) | |
download | bcm5719-llvm-94a55e8169a1e82a2cf954e0495a899cfddee1ac.tar.gz bcm5719-llvm-94a55e8169a1e82a2cf954e0495a899cfddee1ac.zip |
[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
llvm-svn: 248295
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 81a12caecee..d7995627ac7 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1416,6 +1416,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, if (Args.hasArg(OPT_fcuda_disable_target_call_checks)) Opts.CUDADisableTargetCallChecks = 1; + if (Args.hasArg(OPT_fcuda_target_overloads)) + Opts.CUDATargetOverloads = 1; + if (Opts.ObjC1) { if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) { StringRef value = arg->getValue(); |