It is handy for clang tooling, for instance, in source to source transformation.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I don't have a good idea of the intent of this patch. It seems to me that this could do some pretty nasty damage to C code, right?
Can you give better examples/tests of where this is important or useful?
Comment Actions
Right, it could as well as SingleFileParseMode flag.
Can you give better examples/tests of where this is important or useful?
Sure, as I mentioned in the description, source to source transformation; in my case CUDA -> HIP transformation.
CUDA:
#ifdef SOME_MACRO axpy_kernel <<<1, 3>>> (a, y, x); #else axpy_kernel <<<1, 4>>> (a, x, y); #endif
HIP:
#ifdef SOME_MACRO hipLaunchKernelGGL(axpy_kernel, dim3(1), dim3(3), 0, 0, a, y, x); #else hipLaunchKernelGGL(axpy_kernel, dim3(1), dim3(4), 0, 0, a, x, y); #endif