[PATCH] D21567: [OpenCL] Generate struct type for sampler_t and function call for the initializer

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 28 10:36:21 PDT 2016


Anastasia added inline comments.

================
Comment at: lib/Sema/SemaInit.cpp:6961
@@ +6960,3 @@
+        // the initializer.
+        if (!Init->isConstantInitializer(S.Context, false))
+          break;
----------------
yaxunl wrote:
> 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.
> 
Sure! Thanks for checking it!


https://reviews.llvm.org/D21567





More information about the cfe-commits mailing list