[PATCH] D10732: [OPENMP 4.0] Initial support for array sections.

Richard Smith richard at metafoo.co.uk
Wed Jul 22 15:33:59 PDT 2015


rsmith added a comment.

OK, I think what's specified in the OpenMP spec is a little different from what we have here. In particular, an array section does not appear to be a general-purpose expression, it's just a special syntax that can appear only at the top level in certain OpenMP clauses to describe a section of a (possibly multidimensional) array. As such, it doesn't need a real type, doesn't need to be incorporated into normal expression parsing, and so on.

The most straightforward representation would be to give this expression a placeholder type, and make `CheckPlaceholderExpr` reject it. Then, in the places where it's valid (some OpenMP clause arguments, and on the left-hand side of array indexing and array sections), check for this special case before calling `CheckPlaceholderExpr` on the base. That's how we deal with other special-case constructs that can only appear in a few places (bound member functions, overloaded function names, and the like). You can then parse it anywhere (when `OpenMP` is enabled) and it'll get automatically rejected if it appears in a context where it's not permitted.

Please also rename it to `OMPArraySectionExpr` or similar, since this is not a general-purpose construct and is unlikely to be useful anywhere outside OpenMP.


http://reviews.llvm.org/D10732







More information about the cfe-commits mailing list