zuzuf / freeocl

Automatically exported from code.google.com/p/freeocl
GNU Lesser General Public License v3.0
31 stars 8 forks source link

Support for macro parameter concatenation? #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was attempting to compile kernels that use:
#define X(x,y) x ## y

The build log shows expansions of "x ## y" as opposed to "xy" (and kernel 
compilation thus fails).

I am using revision r336, and judging from the source, it appears there is no 
support for parameter concatenation (nor stringification).

I've attached a quick patch that attempts to add it to the parameter 
substitution portion of the macro expander, and seems to do the job for these 
kernels.

Original issue reported on code.google.com by sctinc...@gmail.com on 1 Aug 2014 at 5:56

Attachments:

GoogleCodeExporter commented 9 years ago
It was indeed not supported.

Thanks for the patch! I applied it to both the trunk and llvm branch.

Original comment by zuzu...@gmail.com on 2 Aug 2014 at 11:55