HomePhabricator

[OpenCL] Allow disabling types and declarations associated with extensions

Description

[OpenCL] Allow disabling types and declarations associated with extensions

Added a map to associate types and declarations with extensions.

Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation.

Fixed some bugs for types associated with extensions.

Allow users to use pragma to declare types and functions for supported extensions, e.g.

#pragma OPENCL EXTENSION the_new_extension_name : begin
// declare types and functions associated with the extension here
#pragma OPENCL EXTENSION the_new_extension_name : end

Differential Revision: https://reviews.llvm.org/D21698

Event Timeline

sammccall added inline comments.
/cfe/trunk/lib/Serialization/ASTReader.cpp
3170

This looks like UB: -Wsequence-point complains about it.