[cfe-commits] [OpenCL patch] Clang fails on nested vector literals

Anton Lokhmotov Anton.Lokhmotov at arm.com
Tue Sep 27 04:17:36 PDT 2011


Hi Eli,

Thanks for your prompt review.
 
> It looks like you included some diffs you didn't mean to include?
> (The changes to lib/AST/Expr.cpp and the first set of changes to
> lib/AST/ExprConstant.cpp.)
This code is necessary for Clang to recognise that a vector literal with a
nested constant initializer is constant.

> I follow the concept of your patch, but it looks like you're deleting
> a bunch of necessary code from lib/AST/ExprConstant.cpp.  Do we really
> not have proper tests for those cases?
The removed code only works when the number of initializers is 1 or exactly
equal to the number of vector elements.  Our code is more generic, as it
allows nested vector initializers (see OpenCL 6.1.6).  The added tests cover
all possible uses.

Thanks,
Anton.







More information about the cfe-commits mailing list