clang 24.0.0git
BuiltinTraits.h
Go to the documentation of this file.
1//===--- BuiltinTraits.h - C++ Traits Support Enumerations ----*- C++ -*-=====//
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/// \file
10/// Defines enumerations for traits support.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_BASIC_TYPETRAITS_H
15#define LLVM_CLANG_BASIC_TYPETRAITS_H
16
17#include "llvm/Support/Compiler.h"
18
19namespace clang {
20/// Names for traits that operate specifically on types.
21// enum TypeTrait {
22// UTT_ ...
23// UTT_Last == last UTT_XX in the enum.
24// BTT_ ...
25// BTT_Last == last BTT_XX in the enum.
26// TT_ ...
27// TT_Last == last TT_XX in the enum.
28// };
29
30/// Names for the array type traits.
31// enum ArrayTypeTrait {
32// ATT_ ...
33// ATT_Last == last ATT_XX in the enum.
34// };
35
36/// Names for the "expression or type" traits.
37// enum UnaryExprOrTypeTrait {
38// UETT_ ...
39// UETT_Last == last UETT_XX in the enum.
40// };
41
42/// Names for the expression traits.
43// enum ExpressionTrait {
44// ET_ ...
45// ET_Last == last ET_XX in the enum.
46// };
47#define EMIT_ENUMS
48#include "clang/Basic/Traits.inc"
49
50/// Return the internal name of the trait \p T. Never null.
51const char *getTraitName(TypeTrait T) LLVM_READONLY;
52const char *getTraitName(ArrayTypeTrait T) LLVM_READONLY;
53const char *getTraitName(UnaryExprOrTypeTrait T) LLVM_READONLY;
54const char *getTraitName(ExpressionTrait T) LLVM_READONLY;
55
56/// Return the spelling of the trait \p T. Never null.
57const char *getTraitSpelling(TypeTrait T) LLVM_READONLY;
58const char *getTraitSpelling(ArrayTypeTrait T) LLVM_READONLY;
59const char *getTraitSpelling(UnaryExprOrTypeTrait T) LLVM_READONLY;
60const char *getTraitSpelling(ExpressionTrait T) LLVM_READONLY;
61
62/// Return the arity of the type trait \p T.
63unsigned getTypeTraitArity(TypeTrait T) LLVM_READONLY;
64
65} // namespace clang
66
67#endif
The JSON file list parser is used to communicate input to InstallAPI.
const char * getTraitSpelling(TypeTrait T) LLVM_READONLY
Return the spelling of the trait T. Never null.
const char * getTraitName(TypeTrait T) LLVM_READONLY
Return the internal name of the trait T. Never null.
unsigned getTypeTraitArity(TypeTrait T) LLVM_READONLY
Return the arity of the type trait T.