1 | //===- llvm/IR/DebugInfoFlags.def - Debug info flag definitions -*- 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 | // Macros for running through debug info flags. |
11 | // |
12 | //===----------------------------------------------------------------------===// |
13 | |
14 | #if !(defined HANDLE_DI_FLAG || defined HANDLE_DISP_FLAG) |
15 | #error "Missing macro definition of HANDLE_DI*" |
16 | #endif |
17 | |
18 | #ifndef HANDLE_DI_FLAG |
19 | #define HANDLE_DI_FLAG(ID, NAME) |
20 | #endif |
21 | |
22 | #ifndef HANDLE_DISP_FLAG |
23 | #define HANDLE_DISP_FLAG(ID, NAME) |
24 | #endif |
25 | |
26 | // General flags kept in DINode. |
27 | |
28 | HANDLE_DI_FLAG(0, Zero) // Use it as zero value. |
29 | // For example: void foo(DIFlags Flags = FlagZero). |
30 | HANDLE_DI_FLAG(1, Private) |
31 | HANDLE_DI_FLAG(2, Protected) |
32 | HANDLE_DI_FLAG(3, Public) |
33 | HANDLE_DI_FLAG((1 << 2), FwdDecl) |
34 | HANDLE_DI_FLAG((1 << 3), AppleBlock) |
35 | HANDLE_DI_FLAG((1 << 4), BlockByrefStruct) |
36 | HANDLE_DI_FLAG((1 << 5), Virtual) |
37 | HANDLE_DI_FLAG((1 << 6), Artificial) |
38 | HANDLE_DI_FLAG((1 << 7), Explicit) |
39 | HANDLE_DI_FLAG((1 << 8), Prototyped) |
40 | HANDLE_DI_FLAG((1 << 9), ObjcClassComplete) |
41 | HANDLE_DI_FLAG((1 << 10), ObjectPointer) |
42 | HANDLE_DI_FLAG((1 << 11), Vector) |
43 | HANDLE_DI_FLAG((1 << 12), StaticMember) |
44 | HANDLE_DI_FLAG((1 << 13), LValueReference) |
45 | HANDLE_DI_FLAG((1 << 14), RValueReference) |
46 | // 15 was formerly ExternalTypeRef, but this was never used. |
47 | HANDLE_DI_FLAG((1 << 15), Reserved) |
48 | HANDLE_DI_FLAG((1 << 16), SingleInheritance) |
49 | HANDLE_DI_FLAG((2 << 16), MultipleInheritance) |
50 | HANDLE_DI_FLAG((3 << 16), VirtualInheritance) |
51 | HANDLE_DI_FLAG((1 << 18), IntroducedVirtual) |
52 | HANDLE_DI_FLAG((1 << 19), BitField) |
53 | HANDLE_DI_FLAG((1 << 20), NoReturn) |
54 | HANDLE_DI_FLAG((1 << 21), MainSubprogram) |
55 | HANDLE_DI_FLAG((1 << 22), TypePassByValue) |
56 | HANDLE_DI_FLAG((1 << 23), TypePassByReference) |
57 | HANDLE_DI_FLAG((1 << 24), EnumClass) |
58 | HANDLE_DI_FLAG((1 << 25), Thunk) |
59 | HANDLE_DI_FLAG((1 << 26), Trivial) |
60 | HANDLE_DI_FLAG((1 << 27), BigEndian) |
61 | HANDLE_DI_FLAG((1 << 28), LittleEndian) |
62 | HANDLE_DI_FLAG((1 << 29), AllCallsDescribed) |
63 | |
64 | // To avoid needing a dedicated value for IndirectVirtualBase, we use |
65 | // the bitwise or of Virtual and FwdDecl, which does not otherwise |
66 | // make sense for inheritance. |
67 | HANDLE_DI_FLAG((1 << 2) | (1 << 5), IndirectVirtualBase) |
68 | |
69 | #ifdef DI_FLAG_LARGEST_NEEDED |
70 | // intended to be used with ADT/BitmaskEnum.h |
71 | // NOTE: always must be equal to largest flag, check this when adding new flag |
72 | HANDLE_DI_FLAG((1 << 29), Largest) |
73 | #undef DI_FLAG_LARGEST_NEEDED |
74 | #endif |
75 | |
76 | // Subprogram-specific flags kept in DISubprogram. |
77 | |
78 | // Use this as a zero/initialization value. |
79 | // For example: void foo(DISPFlags Flags = SPFlagZero). |
80 | HANDLE_DISP_FLAG(0, Zero) |
81 | // Virtuality is a two-bit enum field in the LSB of the word. |
82 | // Values should match DW_VIRTUALITY_*. |
83 | HANDLE_DISP_FLAG(1u, Virtual) |
84 | HANDLE_DISP_FLAG(2u, PureVirtual) |
85 | HANDLE_DISP_FLAG((1u << 2), LocalToUnit) |
86 | HANDLE_DISP_FLAG((1u << 3), Definition) |
87 | HANDLE_DISP_FLAG((1u << 4), Optimized) |
88 | |
89 | #ifdef DISP_FLAG_LARGEST_NEEDED |
90 | // Intended to be used with ADT/BitmaskEnum.h. |
91 | // NOTE: Always must be equal to largest flag, check this when adding new flags. |
92 | HANDLE_DISP_FLAG((1 << 4), Largest) |
93 | #undef DISP_FLAG_LARGEST_NEEDED |
94 | #endif |
95 | |
96 | #undef HANDLE_DI_FLAG |
97 | #undef HANDLE_DISP_FLAG |
98 | |