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

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 26 11:10:02 PDT 2018


Anastasia added inline comments.


================
Comment at: lib/Sema/SemaExpr.cpp:3059
                                            /*IndexTypeQuals*/ 0);
       SL = StringLiteral::Create(Context, Str, StringLiteral::Ascii,
                                  /*Pascal*/ false, ResTy, Loc);
----------------
bader wrote:
> Will it work if we fix this issue inside StringLiteral::Create method?
> I just hope it will help us avoid code duplication.
I have added the address space to the creation of `StringLiteral`, but unfortunately it doesn't seems like we can remove similar code in other places because `QualType` created for `StringLiteral` is also used elsewhere and has to match (contain right address space). I.e. here is it used further down to create `PredefinedExpr`. 

So not sure there is any value in doing the change in `StringLiteral` construction really. Unless we could keep it and use `getType()` from `StringLiteral` to resent the `QualType` to be used further down. Let me know what you think about it?


https://reviews.llvm.org/D46049





More information about the cfe-commits mailing list