jlebar created this revision.
jlebar added reviewers: tra, rnk.
jlebar added a subscriber: cfe-commits.
Some function calls in CUDA are allowed to appear in
semantically-correct programs but are an error if they're ever
codegen'ed. Specifically, a host+device function may call a host
function, bu
tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.
Few nits, but looks good otherwise.
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
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 broke
jlebar updated this revision to Diff 67378.
jlebar added a comment.
Address review comments.
Also swap the two tests -- I had the wrong names on them.
https://reviews.llvm.org/D23242
Files:
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaCUDA.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang
jlebar added a comment.
> Hm, these seem completely broken, before and after this patch. I'll handle it
> separately if that's OK.
https://reviews.llvm.org/D23335. The device side equivalent works afaict (and
is very well-tested).
https://reviews.llvm.org/D23242
_
rnk accepted this revision.
rnk added a comment.
lgtm
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.
+ ///
FWIW I never insert doxygen annotations. I figure if
This revision was automatically updated to reflect the committed changes.
Closed by commit rL278759: [CUDA] Raise an error if a wrong-side call is
codegen'ed. (authored by jlebar).
Changed prior to commit:
https://reviews.llvm.org/D23242?vs=67378&id=68103#toc
Repository:
rL LLVM
https://rev