[PATCH] D28814: [OpenCL] Add missing address spaces in IR generation of Blocks

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 07:42:19 PST 2017


Anastasia added inline comments.


================
Comment at: lib/CodeGen/CGBlocks.cpp:723
+                            ? CGM.getNSConcreteStackBlock()
+                            : llvm::Constant::getNullValue(
+                                  CGM.getNSConcreteStackBlock()->getType());
----------------
yaxunl wrote:
> should use CGM.getNullPointer to create a null pointer.
Btw, does it mean we can no longer use generic llvm::Constant::getNullValue helper for PointerTypes? This feels wrong! Is it possible to extend the helper?

Also I find it a bit counter intuitive to use getNullPointer with the second argument QualType for the case like this where we don't have an actual AST type. Why is it needed? Some documentation might be helpful here. :) Could we extend this helper to use default second argument or an overload with one argument only. 


https://reviews.llvm.org/D28814





More information about the cfe-commits mailing list