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

2018-05-09 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331877: [OpenCL] Add constant address space to __func__ in AST. (authored by stulova, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D46049?vs

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

2018-05-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks! https://reviews.llvm.org/D46049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-05-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 145000. Anastasia added a comment. - Changed to adjust common function - Enhanced CodeGen string literal case to also check the predefined expr https://reviews.llvm.org/D46049 Files: include/clang/AST/ASTContext.h lib/AST/ASTContext.cpp lib/AST/Expr

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

2018-05-02 Thread Yaxun Liu via Phabricator via cfe-commits
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 thou

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

2018-05-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. 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. > Also, I am wondering whether this is valid for OpenCL C++. Do we

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

2018-05-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 144892. Anastasia added a comment. Added accidentally removed code and improved the test. https://reviews.llvm.org/D46049 Files: include/clang/AST/ASTContext.h lib/AST/ASTContext.cpp lib/AST/Expr.cpp lib/Sema/SemaExpr.cpp test/SemaOpenCL/predefi

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

2018-05-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 144885. Anastasia added a comment. The best way of adding common helper function I could come up with. The problem is that string literals are created quite differently all over: using various char types and const qualifiers. That seems to cover the most c

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

2018-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Can you add a codegen test for 1.2, 2.0? Also, I am wondering whether this is valid for OpenCL C++. Do we need special handling for string literal? Comment at: lib/AST/Expr.cpp:870 + if (C.getLangOpts().OpenCL && Ty.getAddressSpace() == LangAS::Defaul

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

2018-04-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/AST/Expr.cpp:870 + if (C.getLangOpts().OpenCL && Ty.getAddressSpace() == LangAS::Default) +Ty = C.getAddrSpaceQualType(Ty, LangAS::opencl_constant); + Anastasia wrote: > bader wrote: > > Anastasia wrote: > > >

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

2018-04-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/AST/Expr.cpp:870 + if (C.getLangOpts().OpenCL && Ty.getAddressSpace() == LangAS::Default) +Ty = C.getAddrSpaceQualType(Ty, LangAS::opencl_constant); + bader wrote: > Anastasia wrote: > > bader wrote: > > > As

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

2018-04-27 Thread Alexey Bader via Phabricator via cfe-commits
bader added inline comments. Comment at: lib/AST/Expr.cpp:870 + if (C.getLangOpts().OpenCL && Ty.getAddressSpace() == LangAS::Default) +Ty = C.getAddrSpaceQualType(Ty, LangAS::opencl_constant); + Anastasia wrote: > bader wrote: > > As `Ty` is passed by value

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

2018-04-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/AST/Expr.cpp:870 + if (C.getLangOpts().OpenCL && Ty.getAddressSpace() == LangAS::Default) +Ty = C.getAddrSpaceQualType(Ty, LangAS::opencl_constant); + bader wrote: > As `Ty` is passed by value, shouldn't we ac

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

2018-04-26 Thread Alexey Bader via Phabricator via cfe-commits
bader added inline comments. Comment at: lib/AST/Expr.cpp:870 + if (C.getLangOpts().OpenCL && Ty.getAddressSpace() == LangAS::Default) +Ty = C.getAddrSpaceQualType(Ty, LangAS::opencl_constant); + As `Ty` is passed by value, shouldn't we accept only data loca

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

2018-04-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaExpr.cpp:3059 /*IndexTypeQuals*/ 0); SL = StringLiteral::Create(Context, Str, StringLiteral::Ascii, /*Pascal*/ false, ResTy, Loc); --

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

2018-04-26 Thread Alexey Bader via Phabricator via cfe-commits
bader accepted this revision. bader added inline comments. This revision is now accepted and ready to land. Comment at: lib/Sema/SemaExpr.cpp:3056 + if (LangOpts.OpenCL) +ResTy = Context.getAddrSpaceQualType(ResTy, LangAS::opencl_constant); ResTy = Context.get

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

2018-04-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 144154. Anastasia added a comment. - Renamed test; - Reformatted; - Added constant in StringLiteral creation. https://reviews.llvm.org/D46049 Files: lib/AST/Expr.cpp lib/Sema/SemaExpr.cpp test/SemaOpenCL/predefined-expr.cl Index: test/SemaOpenCL/p

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

2018-04-25 Thread Alexey Bader via Phabricator via cfe-commits
bader added inline comments. Comment at: lib/Sema/SemaExpr.cpp:3059 /*IndexTypeQuals*/ 0); SL = StringLiteral::Create(Context, Str, StringLiteral::Ascii, /*Pascal*/ false, ResTy, Loc); --

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

2018-04-25 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: lib/Sema/SemaExpr.cpp:3056 + if (LangOpts.OpenCL) + ResTy = Context.getAddrSpaceQualType(ResTy, LangAS::opencl_constant); ResTy = Context.getConstantArrayType(ResTy, LengthI, ArrayType::Normal, Nitpic

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

2018-04-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: yaxunl, bader. String literals must be in `constant` address space. https://reviews.llvm.org/D46049 Files: lib/Sema/SemaExpr.cpp test/SemaOpenCL/predefind-expr.cl Index: test/SemaOpenCL/predefind-expr.cl =