[analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:
[clang.git] / lib / Basic / TokenKinds.cpp
blob8cdc1e31950cff3642056d45b58757a3ded9f98a
1 //===--- TokenKinds.cpp - Token Kinds Support -----------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the TokenKind enum and support functions.
12 //===----------------------------------------------------------------------===//
14 #include "clang/Basic/TokenKinds.h"
16 #include <cassert>
17 using namespace clang;
19 static const char * const TokNames[] = {
20 #define TOK(X) #X,
21 #define KEYWORD(X,Y) #X,
22 #include "clang/Basic/TokenKinds.def"
26 const char *tok::getTokenName(enum TokenKind Kind) {
27 assert(Kind < tok::NUM_TOKENS);
28 return TokNames[Kind];
31 const char *tok::getTokenSimpleSpelling(enum TokenKind Kind) {
32 switch (Kind) {
33 #define PUNCTUATOR(X,Y) case X: return Y;
34 #include "clang/Basic/TokenKinds.def"
35 default: break;
38 return 0;