Hi,

We needed in our project (https://github.com/KhronosGroup/webcl-validator)
to be able to define callbacks for handling OpenCL extension pragmas to
catch easily which OpenCL extensions are enabled/disabled.

I attached the patch file and test case for the functionality. Rami Ylimäki
is actually author of the implementation I just wrote the test case and
cleaned up the patch for upstreaming.

I had to add clangParse and clangSema libraries to PPCallbacksTest
compilation, because enabling OpenCL support for preprocessor required
Parser instance. Parser instance actually reads LangOptions from
preprocessor and registers correct pragma handlers to preprocessor.

Any comments, improvements?

Cheers, Mikael Lepistö

Attachment: clang_opencl_extension_pragma_callbacks.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to