[PATCH] D23242: [CUDA] Raise an error if a wrong-side call is codegen'ed.
Justin Lebar via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 9 10:52:14 PDT 2016
jlebar marked 3 inline comments as done.
jlebar added a comment.
> Should be add few tests for calling device functions from host-side global initializers? Perhaps for device->host, too, as there may be unexpected interplay with constructor emptiness checks.
Hm, these seem completely broken, before and after this patch. I'll handle it separately if that's OK.
Comment at: clang/include/clang/Sema/Sema.h:9162
@@ -9161,1 +9161,3 @@
+ /// Check whether we're allowed to call Callee from the current context.
> \p Callee
This file isn't at all consistent about using this. For example, we're missing three `\p`s on IsAllowedCUDACall, two on IdentifyCUDAPreference just above, and four on maybeAddCUDAHostDeviceAttrs.
If we were to do it here, we'd need to add `\p` to three places; not just `Callee`, but also `CFP_Never` and `CFP_WrongSide`.
I'm highly skeptical that this ends up being beneficial overall to readers (i.e. that the clutter in source code outweighs the slightly prettier formatting on doxygen).
More information about the cfe-commits