summaryrefslogtreecommitdiff
path: root/include/clang/Basic/TokenKinds.h
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-06 12:54:18 +0000
committerAlp Toker <alp@nuanti.com>2014-01-06 12:54:18 +0000
commit14e7185bc2a0b7b3aeb1029bc064ac221a63dca5 (patch)
tree91f4d2ed3a7b59c83118ad1946941680e82ec950 /include/clang/Basic/TokenKinds.h
parent7616830a81f643099d796f20529388ec9eab2e19 (diff)
downloadclang-14e7185bc2a0b7b3aeb1029bc064ac221a63dca5.tar.gz
Support diagnostic formatting of keyword tokens
Implemented with a new getKeywordSpelling() accessor. Unlike getTokenName() the result of this function is stable and may be used in diagnostic output. Uses of this feature are split out into the subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/TokenKinds.h')
-rw-r--r--include/clang/Basic/TokenKinds.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h
index e77e732f70..f7a5f9eef9 100644
--- a/include/clang/Basic/TokenKinds.h
+++ b/include/clang/Basic/TokenKinds.h
@@ -65,6 +65,10 @@ const char *getTokenName(enum TokenKind Kind) LLVM_READNONE;
/// Preprocessor::getSpelling().
const char *getPunctuatorSpelling(enum TokenKind Kind) LLVM_READNONE;
+/// \brief Determines the spelling of simple keyword and contextual keyword
+/// tokens like 'int' and 'dynamic_cast'. Returns NULL for other token kinds.
+const char *getKeywordSpelling(enum TokenKind Kind) LLVM_READNONE;
+
/// \brief Return true if this is a raw identifier or an identifier kind.
inline bool isAnyIdentifier(TokenKind K) {
return (K == tok::identifier) || (K == tok::raw_identifier);