[PATCH] D21567: [OpenCL] Generate struct type for sampler_t and function call for the initializer
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 28 10:25:37 PDT 2016
yaxunl marked 2 inline comments as done.
================
Comment at: lib/Sema/SemaInit.cpp:6961
@@ +6960,3 @@
+ // the initializer.
+ if (!Init->isConstantInitializer(S.Context, false))
+ break;
----------------
Anastasia wrote:
> I think you don't need this check any more because this code is inside the else part. Could you please double check before committing?
I tried removing this line. There will be extra diagnostics emitted for test case:
constant sampler_t glb_smp6 = glb_smp;
We only expects error msg: `initializer element is not a compile-time constant`. However in addition to that, we also get `sampler_t initialization requires 32-bit integer, not '__constant sampler_t'`. This is because the break is removed. So I think better not removed the line.
https://reviews.llvm.org/D21567
More information about the cfe-commits
mailing list