aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorNeil Hickey <neil.hickey@arm.com>2019-07-16 14:57:32 +0000
committerNeil Hickey <neil.hickey@arm.com>2019-07-16 14:57:32 +0000
commit8ece3b6719948a08d1f654d97f53dbd08891199d (patch)
tree1412390fe24e2b78182f07c0995fcb0430aaca4a /clang/lib/Sema/SemaInit.cpp
parent655cb4a2d702b70899f3ad384d047537e02698d8 (diff)
downloadllvm-8ece3b6719948a08d1f654d97f53dbd08891199d.zip
llvm-8ece3b6719948a08d1f654d97f53dbd08891199d.tar.gz
llvm-8ece3b6719948a08d1f654d97f53dbd08891199d.tar.bz2
[OpenCL] Fixing sampler initialisations for C++ mode.
Allow conversions between integer and sampler type. Differential Revision: https://reviews.llvm.org/D64791 llvm-svn: 366212
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index b3b3469..bc10696 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -5640,6 +5640,9 @@ void InitializationSequence::InitializeFrom(Sema &S,
bool allowObjCWritebackConversion = S.getLangOpts().ObjCAutoRefCount &&
Entity.isParameterKind();
+ if (TryOCLSamplerInitialization(S, *this, DestType, Initializer))
+ return;
+
// We're at the end of the line for C: it's either a write-back conversion
// or it's a C assignment. There's no need to check anything else.
if (!S.getLangOpts().CPlusPlus) {
@@ -5649,9 +5652,6 @@ void InitializationSequence::InitializeFrom(Sema &S,
return;
}
- if (TryOCLSamplerInitialization(S, *this, DestType, Initializer))
- return;
-
if (TryOCLZeroOpaqueTypeInitialization(S, *this, DestType, Initializer))
return;