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