This revision was automatically updated to reflect the committed changes.
Closed by commit rL258643: [CUDA] Disallow variadic functions other than printf
in device code. (authored by jlebar).
Changed prior to commit:
http://reviews.llvm.org/D16484?vs=45736&id=45811#toc
Repository:
rL LLVM
h
jlebar updated this revision to Diff 45736.
jlebar marked an inline comment as done.
jlebar added a comment.
Add check for extern "C" printf -- we don't want to take just any printf!
http://reviews.llvm.org/D16484
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
tes
jlebar added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:8291-8293
@@ +8290,5 @@
+// in device-side CUDA code.
+if (NewFD->isVariadic() && (NewFD->hasAttr() ||
+NewFD->hasAttr()) &&
+!(II && II->isStr("printf") && !D.isFunctio
tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.
Small nit. LGTM otherwise.
Comment at: lib/Sema/SemaDecl.cpp:8291-8293
@@ +8290,5 @@
+// in device-side CUDA code.
+if (NewFD->isVariadic() && (NewFD->hasAttr() ||
+
jlebar created this revision.
jlebar added a reviewer: tra.
jlebar added subscribers: jhen, echristo, cfe-commits.
http://reviews.llvm.org/D16484
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/SemaCUDA/va-arg.cu
test/SemaCUDA/vararg.cu
Index: test/SemaCUDA/v