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
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
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
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
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
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
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
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
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:
> > >
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
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
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
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
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 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
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
bader added inline comments.
Comment at: lib/Sema/SemaExpr.cpp:3059
/*IndexTypeQuals*/ 0);
SL = StringLiteral::Create(Context, Str, StringLiteral::Ascii,
/*Pascal*/ false, ResTy, Loc);
--
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
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
=
19 matches
Mail list logo