diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2015-03-18 12:55:29 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2015-03-18 12:55:29 +0000 |
commit | b1152f1e56349dc0c409abe5a8b83871431dc8e5 (patch) | |
tree | a2e332dd8c63dc7ddc0bc907f6a135495a19f68b /clang/lib/Basic/IdentifierTable.cpp | |
parent | 794ffb7da384367b4d334cacaf7a03b203a52692 (diff) | |
download | bcm5719-llvm-b1152f1e56349dc0c409abe5a8b83871431dc8e5.tar.gz bcm5719-llvm-b1152f1e56349dc0c409abe5a8b83871431dc8e5.zip |
OpenCL: CL2.0 atomic types
OpenCL C Spec v2.0 Section 6.13.11
- Made c11 _Atomic being not accepted for OpenCL
- Implemented CL2.0 atomics by aliasing them to the corresponding c11 atomic types using implicit typedef
- Added diagnostics for atomics Khronos extension enabling
llvm-svn: 232631
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | clang/lib/Basic/IdentifierTable.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index db148f493f4..bd2840db4c7 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -106,9 +106,11 @@ namespace { KEYC11 = 0x400, KEYARC = 0x800, KEYNOMS18 = 0x01000, - WCHARSUPPORT = 0x02000, - HALFSUPPORT = 0x04000, - KEYALL = (0xffff & ~KEYNOMS18) // Because KEYNOMS18 is used to exclude. + KEYNOOPENCL = 0x02000, + WCHARSUPPORT = 0x04000, + HALFSUPPORT = 0x08000, + KEYALL = (0xffff & ~KEYNOMS18 & + ~KEYNOOPENCL) // KEYNOMS18 and KEYNOOPENCL are used to exclude. }; /// \brief How a keyword is treated in the selected standard. @@ -156,7 +158,12 @@ static void AddKeyword(StringRef Keyword, // Don't add this keyword under MSVCCompat. if (LangOpts.MSVCCompat && (Flags & KEYNOMS18) && !LangOpts.isCompatibleWithMSVC(19)) - return; + return; + + // Don't add this keyword under OpenCL. + if (LangOpts.OpenCL && (Flags & KEYNOOPENCL)) + return; + // Don't add this keyword if disabled in this language. if (AddResult == KS_Disabled) return; |