[PATCH] Make pretty-print output valid OpenCL code
fox at emphotonics.com
Mon Jul 7 12:39:27 PDT 2014
Pretty-printing OpenCL code from an AST does not produce valid,
compilable code. Making this possible is valuable for certain kinds of
In this patch, I try to rectify two issues with the pretty-printed code.
1) The AST treats "local" variable declarations as having a special
storage class specifier, which pretty-prints as <<work-group-local>> in
VisitVarDecl. As a result, these declarations give a syntax error when
one attempts to compile the pretty-printed code.
2) VisitFunctionDecl will print function attributes after the function
declaration, which is valid syntax for most attributes, but OpenCL
function attributes specifically must come before the function declaration.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1194 bytes
Desc: not available
More information about the cfe-commits