Specifiers.h revision 203955
1//===--- Specifiers.h - Declaration and Type Specifiers ---------*- C++ -*-===//
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 defines various enumerations that describe declaration and
11// type specifiers.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_BASIC_SPECIFIERS_H
16#define LLVM_CLANG_BASIC_SPECIFIERS_H
17
18namespace clang {
19  /// \brief Specifies the width of a type, e.g., short, long, or long long.
20  enum TypeSpecifierWidth {
21    TSW_unspecified,
22    TSW_short,
23    TSW_long,
24    TSW_longlong
25  };
26
27  /// \brief Specifies the signedness of a type, e.g., signed or unsigned.
28  enum TypeSpecifierSign {
29    TSS_unspecified,
30    TSS_signed,
31    TSS_unsigned
32  };
33
34  /// \brief Specifies the kind of type.
35  enum TypeSpecifierType {
36    TST_unspecified,
37    TST_void,
38    TST_char,
39    TST_wchar,        // C++ wchar_t
40    TST_char16,       // C++0x char16_t
41    TST_char32,       // C++0x char32_t
42    TST_int,
43    TST_float,
44    TST_double,
45    TST_bool,         // _Bool
46    TST_decimal32,    // _Decimal32
47    TST_decimal64,    // _Decimal64
48    TST_decimal128,   // _Decimal128
49    TST_enum,
50    TST_union,
51    TST_struct,
52    TST_class,        // C++ class type
53    TST_typename,     // Typedef, C++ class-name or enum name, etc.
54    TST_typeofType,
55    TST_typeofExpr,
56    TST_decltype,     // C++0x decltype
57    TST_auto,         // C++0x auto
58    TST_error         // erroneous type
59  };
60
61  /// WrittenBuiltinSpecs - Structure that packs information about the
62  /// type specifiers that were written in a particular type specifier
63  /// sequence.
64  struct WrittenBuiltinSpecs {
65    /*DeclSpec::TST*/ unsigned Type  : 5;
66    /*DeclSpec::TSS*/ unsigned Sign  : 2;
67    /*DeclSpec::TSW*/ unsigned Width : 2;
68    bool ModeAttr : 1;
69  };
70
71  /// AccessSpecifier - A C++ access specifier (public, private,
72  /// protected), plus the special value "none" which means
73  /// different things in different contexts.
74  enum AccessSpecifier {
75    AS_public,
76    AS_protected,
77    AS_private,
78    AS_none
79  };
80
81} // end namespace clang
82
83#endif // LLVM_CLANG_BASIC_SPECIFIERS_H
84