diff options
author | Egor Churaev <egor.churaev@gmail.com> | 2016-12-23 14:55:49 +0000 |
---|---|---|
committer | Egor Churaev <egor.churaev@gmail.com> | 2016-12-23 14:55:49 +0000 |
commit | 89831421af27b23573033e24594d21b804de1a95 (patch) | |
tree | 6970d07aaa54e1f724ee6b1cb9aa0308c6191b14 /clang/lib/Sema/SemaExpr.cpp | |
parent | 383edba1fdbbe6a256a44f847ac62ff5953c2679 (diff) | |
download | bcm5719-llvm-89831421af27b23573033e24594d21b804de1a95.tar.gz bcm5719-llvm-89831421af27b23573033e24594d21b804de1a95.zip |
Fix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand."
Summary: Fixed warnings in commit: https://reviews.llvm.org/rL290171
Reviewers: djasper, Anastasia
Subscribers: yaxunl, cfe-commits, bader
Differential Revision: https://reviews.llvm.org/D27981
llvm-svn: 290431
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index b8883456911..3c554c9a524 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -9635,6 +9635,18 @@ QualType Sema::CheckCompareOperands(ExprResult &LHS, ExprResult &RHS, return ResultTy; } + if (getLangOpts().OpenCLVersion >= 200) { + if (LHSIsNull && RHSType->isQueueT()) { + LHS = ImpCastExprToType(LHS.get(), RHSType, CK_NullToPointer); + return ResultTy; + } + + if (LHSType->isQueueT() && RHSIsNull) { + RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer); + return ResultTy; + } + } + return InvalidOperands(Loc, LHS, RHS); } |