]> granicus.if.org Git - clang/commit
[OpenCL] Allow disabling types and declarations associated with extensions
authorYaxun Liu <Yaxun.Liu@amd.com>
Fri, 16 Dec 2016 19:22:08 +0000 (19:22 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Fri, 16 Dec 2016 19:22:08 +0000 (19:22 +0000)
commit30d9d8921a58be7a796ab22bd3ac6eb350ab9629
tree9abe2cae1232fb6dfad42540f24cdc185e62e608
parentb206e2ea7775db49cd2a0b21f64c792b2b9e1ec7
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289979 91177308-0d34-0410-b5e6-96231b3b80d8
29 files changed:
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/OpenCLImageTypes.def
include/clang/Basic/OpenCLOptions.h
include/clang/Basic/TargetInfo.h
include/clang/Sema/Overload.h
include/clang/Sema/Sema.h
include/clang/Serialization/ASTBitCodes.h
include/clang/Serialization/ASTReader.h
include/clang/Serialization/ASTWriter.h
lib/Basic/Targets.cpp
lib/Frontend/InitPreprocessor.cpp
lib/Headers/opencl-c.h
lib/Parse/ParsePragma.cpp
lib/Parse/Parser.cpp
lib/Sema/DeclSpec.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaCast.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaOverload.cpp
lib/Sema/SemaType.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/CodeGenOpenCL/extension-begin.cl [new file with mode: 0644]
test/Parser/opencl-atomics-cl20.cl
test/Parser/opencl-pragma.cl
test/SemaOpenCL/extension-begin.cl [new file with mode: 0644]
test/SemaOpenCL/extensions.cl