[PATCH] Add support for unroll pragma

Mark Heffernan meheff at google.com
Wed Jul 9 10:53:36 PDT 2014


On Wed, Jul 9, 2014 at 7:42 AM, Aaron Ballman <aaron.ballman at gmail.com> wrote:
> I wonder how horrible it would be to simply canonicalize based on
> compiler options when pretty printing, and skip this field entirely.
> Eg) when CUDA is on, pretty print does not emit the parens. When CUDA
> mode is off, it does emit the parens. Yes, this isn't *exactly* what
> the user wrote, but the semantics are identical either way.

It would be nice to get rid of the ValueInParens ugliness.  One idea
might be to consider the form with parentheses an error when compiling
for cuda and the form without parentheses an error when compiling for
!cuda.  Then the parentheses can be emitted based only on whether cuda
mode is enabled and we don't have to worry about the pragmas being
silently transformed from one form to the other when printing out the
ast.

Mark



More information about the cfe-commits mailing list