[PATCH] D15858: Warn undeclared identifiers in CUDA kernel calls
Jason Henline via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 7 11:03:23 PST 2016
jhen added inline comments.
================
Comment at: include/clang/AST/ExprCXX.h:177
@@ +176,3 @@
+ void setConfig(CallExpr *E) {
+ assert(!getConfig() &&
+ "Cannot call setConfig if config is not null");
----------------
Sounds good. The current version introduces a new constructor for `CallExpr` that takes an `ArrayRef<Expr*>` for the preargs, and the `CUDAKernelCallExpr` constructor now passes the `Config` argument explicitly to this constructor. This new constructor also replaces the old one that took the number of preargs. In the new constructor I designed the dependency handling for the preargs to mirror the way it is done for regular function arguments, and I extracted a little helper function so as not to repeat that code.
I also introduced another new `CallExpr` constructor to handle the common case of zero preargs, and replaced calls to the old `NumPreArgs` constructor where zero `NumPreArgs` was passed explicitly with calls to this new constructor.
http://reviews.llvm.org/D15858
More information about the cfe-commits
mailing list