[PATCH] D46049: [OpenCL] Add constant address space to __func__ in AST

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 2 10:01:16 PDT 2018


yaxunl added a comment.

In https://reviews.llvm.org/D46049#1085388, @Anastasia wrote:

> In https://reviews.llvm.org/D46049#1081196, @yaxunl wrote:
>
> > Can you add a codegen test for 1.2, 2.0?
>
>
> Anything specific you would like me to check? I am not modifying anything in CodeGen here though.


You changed the AST of string literal. We need to check whether the CodeGen for string literal still works.



================
Comment at: lib/AST/ASTContext.cpp:3632
 
+QualType ASTContext::getStringLiteralBaseType() const {
+  // OpenCL v1.1 s6.5.3: a string literal is in the constant address space.
----------------
This is not right. The base type of a string literal may not be CharTy, therefore this function needs an input argument which is the original base type and it returns the adjusted base type. (Maybe it should be renamed as adjustStringLiteralBaseType?) Also, you can then use it in StringLiteral::CreateEmpty by passing an empty QualType().


https://reviews.llvm.org/D46049





More information about the cfe-commits mailing list