[docs] Fix build-docs.sh
[llvm-project.git] / clang / lib / Basic / ExpressionTraits.cpp
blob5fde1940038f85dfd71e933cc20466497d1b716b
1 //===--- ExpressionTraits.cpp - Expression Traits Support -----------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the expression traits support functions.
11 //===----------------------------------------------------------------------===//
13 #include "clang/Basic/ExpressionTraits.h"
14 #include "llvm/Support/ErrorHandling.h"
15 #include <cassert>
16 using namespace clang;
18 static constexpr const char *ExpressionTraitNames[] = {
19 #define EXPRESSION_TRAIT(Spelling, Name, Key) #Name,
20 #include "clang/Basic/TokenKinds.def"
23 static constexpr const char *ExpressionTraitSpellings[] = {
24 #define EXPRESSION_TRAIT(Spelling, Name, Key) #Spelling,
25 #include "clang/Basic/TokenKinds.def"
28 const char *clang::getTraitName(ExpressionTrait T) {
29 assert(T <= ET_Last && "invalid enum value!");
30 return ExpressionTraitNames[T];
33 const char *clang::getTraitSpelling(ExpressionTrait T) {
34 assert(T <= ET_Last && "invalid enum value!");
35 return ExpressionTraitSpellings[T];