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
28HANDLE_DI_FLAG(0, Zero) // Use it as zero value.
29 // For example: void foo(DIFlags Flags = FlagZero).
30HANDLE_DI_FLAG(1, Private)
31HANDLE_DI_FLAG(2, Protected)
32HANDLE_DI_FLAG(3, Public)
33HANDLE_DI_FLAG((1 << 2), FwdDecl)
34HANDLE_DI_FLAG((1 << 3), AppleBlock)
35HANDLE_DI_FLAG((1 << 4), BlockByrefStruct)
36HANDLE_DI_FLAG((1 << 5), Virtual)
37HANDLE_DI_FLAG((1 << 6), Artificial)
38HANDLE_DI_FLAG((1 << 7), Explicit)
39HANDLE_DI_FLAG((1 << 8), Prototyped)
40HANDLE_DI_FLAG((1 << 9), ObjcClassComplete)
41HANDLE_DI_FLAG((1 << 10), ObjectPointer)
42HANDLE_DI_FLAG((1 << 11), Vector)
43HANDLE_DI_FLAG((1 << 12), StaticMember)
44HANDLE_DI_FLAG((1 << 13), LValueReference)
45HANDLE_DI_FLAG((1 << 14), RValueReference)
46// 15 was formerly ExternalTypeRef, but this was never used.
47HANDLE_DI_FLAG((1 << 15), Reserved)
48HANDLE_DI_FLAG((1 << 16), SingleInheritance)
49HANDLE_DI_FLAG((2 << 16), MultipleInheritance)
50HANDLE_DI_FLAG((3 << 16), VirtualInheritance)
51HANDLE_DI_FLAG((1 << 18), IntroducedVirtual)
52HANDLE_DI_FLAG((1 << 19), BitField)
53HANDLE_DI_FLAG((1 << 20), NoReturn)
54HANDLE_DI_FLAG((1 << 21), MainSubprogram)
55HANDLE_DI_FLAG((1 << 22), TypePassByValue)
56HANDLE_DI_FLAG((1 << 23), TypePassByReference)
57HANDLE_DI_FLAG((1 << 24), EnumClass)
58HANDLE_DI_FLAG((1 << 25), Thunk)
59HANDLE_DI_FLAG((1 << 26), Trivial)
60HANDLE_DI_FLAG((1 << 27), BigEndian)
61HANDLE_DI_FLAG((1 << 28), LittleEndian)
62HANDLE_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.
67HANDLE_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
72HANDLE_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).
80HANDLE_DISP_FLAG(0, Zero)
81// Virtuality is a two-bit enum field in the LSB of the word.
82// Values should match DW_VIRTUALITY_*.
83HANDLE_DISP_FLAG(1u, Virtual)
84HANDLE_DISP_FLAG(2u, PureVirtual)
85HANDLE_DISP_FLAG((1u << 2), LocalToUnit)
86HANDLE_DISP_FLAG((1u << 3), Definition)
87HANDLE_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.
92HANDLE_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