From 7a51313d8a0a358bb92eb5dbf8fd846b7c48e7fe Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 15 Mar 2008 23:59:48 +0000 Subject: Make a major restructuring of the clang tree: introduce a top-level lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402 --- clang/lib/Basic/TokenKinds.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 clang/lib/Basic/TokenKinds.cpp (limited to 'clang/lib/Basic/TokenKinds.cpp') diff --git a/clang/lib/Basic/TokenKinds.cpp b/clang/lib/Basic/TokenKinds.cpp new file mode 100644 index 00000000000..bde8a5598b4 --- /dev/null +++ b/clang/lib/Basic/TokenKinds.cpp @@ -0,0 +1,29 @@ +//===--- TokenKinds.cpp - Token Kinds Support -----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the TokenKind enum and support functions. +// +//===----------------------------------------------------------------------===// + +#include "clang/Basic/TokenKinds.h" + +#include +using namespace clang; + +static const char * const TokNames[] = { +#define TOK(X) #X, +#define KEYWORD(X,Y) #X, +#include "clang/Basic/TokenKinds.def" + 0 +}; + +const char *tok::getTokenName(enum TokenKind Kind) { + assert(Kind < tok::NUM_TOKENS); + return TokNames[Kind]; +} -- cgit v1.2.3