[PATCH] D12453: [CUDA] Allow function overloads based on host/device attributes.
Eli Bendersky via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 31 15:59:40 PDT 2015
eliben added inline comments.
================
Comment at: include/clang/Sema/Sema.h:8599
@@ +8598,3 @@
+ CFP_Never, // Invalid caller/callee combination.
+ CFP_LastResort, // same as CFP_Never or CFP_Fallback, depending on
+ // -fcuda-disable-target-call-checks option
----------------
The comment should explain exactly how it depends on the option
================
Comment at: lib/AST/ItaniumMangle.cpp:504
@@ +503,3 @@
+ if (FD->hasAttr<CUDADeviceAttr>() && FD->hasAttr<CUDAHostAttr>())
+ Out << "Ua6deviceUa4host";
+
----------------
Why device before host?
================
Comment at: lib/Sema/SemaCUDA.cpp:98
@@ +97,3 @@
+ CUDAFunctionTarget CallerTarget =
+ Caller ? IdentifyCUDATarget(Caller) : Sema::CFT_Host,
+ CalleeTarget = IdentifyCUDATarget(Callee);
----------------
Why allow Caller to be nullptr but not Callee? Also, != nullptr?
================
Comment at: lib/Sema/SemaExprCXX.cpp:2277
@@ +2276,3 @@
+ Matches.set_size(N);
+ } else
+ ++I;
----------------
Nit: wrap the ++I in braces too, otherwise this looks really weird
http://reviews.llvm.org/D12453
More information about the cfe-commits
mailing list