summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-10-22 03:52:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-10-22 03:52:15 +0000
commiteb7927ee8f2838e153c3002e94a6af9d18b76d92 (patch)
tree10d6ff417aaa6cdd0223aa49a76b526d17c270dd /clang/lib/Basic
parent9c077cf33d5a42ee0763d18228d59561f82c8917 (diff)
downloadbcm5719-llvm-eb7927ee8f2838e153c3002e94a6af9d18b76d92.tar.gz
bcm5719-llvm-eb7927ee8f2838e153c3002e94a6af9d18b76d92.zip
[coroutines] Add lexer support for co_await, co_yield, and co_return keywords.
Add -fcoroutines flag (just for -cc1 for now) to enable the feature. Early indications are that this will be part of -std=c++1z. llvm-svn: 250980
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 199815aa891..67de1cb6fda 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -111,7 +111,8 @@ namespace {
KEYCONCEPTS = 0x10000,
KEYOBJC2 = 0x20000,
KEYZVECTOR = 0x40000,
- KEYALL = (0x7ffff & ~KEYNOMS18 &
+ KEYCOROUTINES = 0x80000,
+ KEYALL = (0xfffff & ~KEYNOMS18 &
~KEYNOOPENCL) // KEYNOMS18 and KEYNOOPENCL are used to exclude.
};
@@ -147,6 +148,7 @@ static KeywordStatus getKeywordStatus(const LangOptions &LangOpts,
if (LangOpts.ObjC2 && (Flags & KEYARC)) return KS_Enabled;
if (LangOpts.ConceptsTS && (Flags & KEYCONCEPTS)) return KS_Enabled;
if (LangOpts.ObjC2 && (Flags & KEYOBJC2)) return KS_Enabled;
+ if (LangOpts.Coroutines && (Flags & KEYCOROUTINES)) return KS_Enabled;
if (LangOpts.CPlusPlus && (Flags & KEYCXX11)) return KS_Future;
return KS_Disabled;
}
OpenPOWER on IntegriCloud