summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp15
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;
OpenPOWER on IntegriCloud