Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-04-12 Thread Yaxun Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rL266111: PR19957: [OpenCL] Incorrectly accepts implicit address space conversion with… (authored by yaxunl). Changed prior to commit:

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-04-07 Thread Anastasia Stulova via cfe-commits
Anastasia added a comment. In http://reviews.llvm.org/D17412#391351, @Matt wrote: > In http://reviews.llvm.org/D17412#391322, @Anastasia wrote: > > > Cool, thanks! I think we should commit this ASAP. > > > > @Xiuli/@Matt, do you have any more comments here? > > > Hi! I think that "Matt" for this

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-04-05 Thread Xiuli PAN via cfe-commits
pxli168 accepted this revision. pxli168 added a comment. LGTM! Thanks! http://reviews.llvm.org/D17412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-04-04 Thread Matt D. via cfe-commits
Matt added a comment. In http://reviews.llvm.org/D17412#391322, @Anastasia wrote: > Cool, thanks! I think we should commit this ASAP. > > @Xiuli/@Matt, do you have any more comments here? Hi! I think that "Matt" for this one would be @arsenm :-) http://reviews.llvm.org/D17412

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-04-04 Thread Anastasia Stulova via cfe-commits
Anastasia added a subscriber: Matt. Anastasia added a comment. Cool, thanks! I think we should commit this ASAP. @Xiuli/@Matt, do you have any more comments here? http://reviews.llvm.org/D17412 ___ cfe-commits mailing list

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-04-01 Thread Yaxun Liu via cfe-commits
yaxunl marked 2 inline comments as done. Comment at: test/CodeGenOpenCL/address-spaces-conversions.cl:1 @@ -1,2 +1,2 @@ // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -ffake-address-space-map -cl-std=CL2.0 -emit-llvm -o - | FileCheck %s Anastasia

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-30 Thread Yaxun Liu via cfe-commits
yaxunl updated this revision to Diff 52080. yaxunl marked 3 inline comments as done. yaxunl added a comment. Add back a blank line deleted by accident. Add OpenCL to a comment. http://reviews.llvm.org/D17412 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/AST/ASTContext.cpp

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-30 Thread Anastasia Stulova via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM, please correct two small issues commented here! Comment at: lib/Sema/SemaExpr.cpp:169 @@ -168,4 +168,3 @@ break; - bool Warn =

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-30 Thread Yaxun Liu via cfe-commits
yaxunl updated this revision to Diff 52073. yaxunl marked 6 inline comments as done. yaxunl added a comment. Revised by Anastasia's comments. Added comments to code for cases 1a-c and 2a-c. Added codegen test for missing cases of 1a-b and 2a-b. Rename variables in sema test.

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-30 Thread Yaxun Liu via cfe-commits
yaxunl added inline comments. Comment at: test/SemaOpenCL/address-spaces-conversions-cl2.0.cl:276 @@ +275,3 @@ + constant char *arg_const_ch; + var_void_const = 0 ? var_cond : arg_const_ch; +#ifndef CONSTANT Anastasia wrote: > btw, what happens if we assign

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-30 Thread Yaxun Liu via cfe-commits
yaxunl marked 6 inline comments as done. Comment at: lib/AST/ASTContext.cpp:7613 @@ +7612,3 @@ +if (getLangOpts().OpenCL) { + if (LHS.getUnqualifiedType() != RHS.getUnqualifiedType() || + LQuals.getCVRQualifiers() != RQuals.getCVRQualifiers())

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-29 Thread Anastasia Stulova via cfe-commits
Anastasia added a comment. LG, apart from small comments mentioned here. Comment at: lib/AST/ASTContext.cpp:7613 @@ +7612,3 @@ +if (getLangOpts().OpenCL) { + if (LHS.getUnqualifiedType() != RHS.getUnqualifiedType() || + LQuals.getCVRQualifiers() !=

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-23 Thread Yaxun Liu via cfe-commits
yaxunl removed rL LLVM as the repository for this revision. yaxunl updated this revision to Diff 51460. yaxunl marked 13 inline comments as done. yaxunl added a comment. Added comments. Revised test. http://reviews.llvm.org/D17412 Files: include/clang/Basic/DiagnosticSemaKinds.td

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-15 Thread Xiuli PAN via cfe-commits
pxli168 added inline comments. Comment at: lib/AST/ASTContext.cpp:7613 @@ +7612,3 @@ +if (getLangOpts().OpenCL) { + if (LHS.getUnqualifiedType() != RHS.getUnqualifiedType() || + LQuals.getCVRQualifiers() != RQuals.getCVRQualifiers()) Anastasia

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-03-09 Thread Xiuli PAN via cfe-commits
pxli168 added a comment. The logic is still to complex and I hope it can be optimized. Comment at: lib/Sema/SemaExpr.cpp:6222-6227 @@ -6188,1 +6221,8 @@ +auto ResultAddrSpace = ResultTy.getQualifiers().getAddressSpace(); +LHSCastKind = lhQual.getAddressSpace() ==

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-02-26 Thread Yaxun Liu via cfe-commits
yaxunl added inline comments. Comment at: lib/AST/ASTContext.cpp:7605 @@ -7604,3 +7604,3 @@ // If two types are identical, they are compatible. if (LHSCan == RHSCan) return LHS; Anastasia wrote: > I feel like the AS check should be lifted here instead,

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-02-26 Thread Yaxun Liu via cfe-commits
yaxunl updated this revision to Diff 49232. yaxunl marked 7 inline comments as done. yaxunl added a comment. Revised as Anastasis suggested. Modified mergeTypes() for un-handled case. Separate sema tests for condition operator to a new file. Repository: rL LLVM

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-02-26 Thread Anastasia Stulova via cfe-commits
Anastasia added a comment. I think we are not covering all the possible cases with tests now! May be we could also create a separate cl file since it becomes quite large. Comment at: lib/AST/ASTContext.cpp:7605 @@ -7604,3 +7604,3 @@ // If two types are identical, they are

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-02-26 Thread Yaxun Liu via cfe-commits
yaxunl marked 2 inline comments as done. Comment at: lib/Sema/SemaExpr.cpp:6194-6203 @@ +6193,12 @@ + + incompatTy = S.Context.getPointerType( + S.Context.getAddrSpaceQualType(S.Context.VoidTy, ResultAddrSpace)); + LHS = S.ImpCastExprToType(LHS.get(),

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-02-25 Thread Xiuli PAN via cfe-commits
pxli168 added inline comments. Comment at: lib/Sema/SemaExpr.cpp:6194-6203 @@ +6193,12 @@ + + incompatTy = S.Context.getPointerType( + S.Context.getAddrSpaceQualType(S.Context.VoidTy, ResultAddrSpace)); + LHS = S.ImpCastExprToType(LHS.get(), incompatTy, +

Re: [PATCH] D17412: PR19957: [OpenCL] incorrectly accepts implicit address space conversion with ternary operator

2016-02-24 Thread Yaxun Liu via cfe-commits
yaxunl updated the summary for this revision. yaxunl removed a reviewer: pekka.jaaskelainen. yaxunl added a subscriber: pekka.jaaskelainen. yaxunl set the repository for this revision to rL LLVM. yaxunl updated this revision to Diff 48967. yaxunl marked 5 inline comments as done. yaxunl added a