diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-11-28 16:09:28 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-11-28 16:09:28 +0000 |
commit | 59c55e724945daa060a5f1aaecbfd4de04770e93 (patch) | |
tree | 60d2c91073b8ca323a7bb08296c5ba74b134d0f6 /lib/Basic/TokenKinds.cpp | |
parent | 149594457da7edfea2ce537ed18ca1b412dffd54 (diff) |
This patch adds a PUNCTUATOR macro (specialization of TOK) in TokenKinds.def and makes use of it in tok::getTokenSimpleSpelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/TokenKinds.cpp')
-rw-r--r-- | lib/Basic/TokenKinds.cpp | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/lib/Basic/TokenKinds.cpp b/lib/Basic/TokenKinds.cpp index 4afeaf01b7..8cdc1e3195 100644 --- a/lib/Basic/TokenKinds.cpp +++ b/lib/Basic/TokenKinds.cpp @@ -30,59 +30,8 @@ const char *tok::getTokenName(enum TokenKind Kind) { const char *tok::getTokenSimpleSpelling(enum TokenKind Kind) { switch (Kind) { - case tok::l_square: return "["; - case tok::r_square: return "]"; - case tok::l_paren: return "("; - case tok::r_paren: return ")"; - case tok::l_brace: return "{"; - case tok::r_brace: return "}"; - case tok::period: return "."; - case tok::ellipsis: return "..."; - case tok::amp: return "&"; - case tok::ampamp: return "&&"; - case tok::ampequal: return "&="; - case tok::star: return "*"; - case tok::starequal: return "*="; - case tok::plus: return "+"; - case tok::plusplus: return "++"; - case tok::plusequal: return "+="; - case tok::minus: return "-"; - case tok::arrow: return "->"; - case tok::minusminus: return "--"; - case tok::minusequal: return "-="; - case tok::tilde: return "~"; - case tok::exclaim: return "!"; - case tok::exclaimequal: return "!="; - case tok::slash: return "/"; - case tok::slashequal: return "/="; - case tok::percent: return "%"; - case tok::percentequal: return "%="; - case tok::less: return "<"; - case tok::lessless: return "<<"; - case tok::lessequal: return "<="; - case tok::lesslessequal: return "<<="; - case tok::greater: return ">"; - case tok::greatergreater: return ">>"; - case tok::greaterequal: return ">="; - case tok::greatergreaterequal: return ">>="; - case tok::caret: return "^"; - case tok::caretequal: return "^="; - case tok::pipe: return "|"; - case tok::pipepipe: return "||"; - case tok::pipeequal: return "|="; - case tok::question: return "?"; - case tok::colon: return ":"; - case tok::semi: return ";"; - case tok::equal: return "="; - case tok::equalequal: return "=="; - case tok::comma: return ","; - case tok::hash: return "#"; - case tok::hashhash: return "##"; - case tok::hashat: return "#@"; - case tok::periodstar: return ".*"; - case tok::arrowstar: return "->*"; - case tok::coloncolon: return "::"; - case tok::at: return "@"; +#define PUNCTUATOR(X,Y) case X: return Y; +#include "clang/Basic/TokenKinds.def" default: break; } |