llvm.org GIT mirror llvm / 1d13545
[DebugInfo] Add a new DI flag to record if a C++ record is a trivial type Summary: This flag is used when emitting debug info and is needed to initialize subprogram and member function attributes (function options) for Codeview. These function options are used to create an accurate compiler type for UDT symbols (class/struct/union) from PDBs. It is not easy to determine if a C++ record is trivial or not based on the current DICompositeType flags and other accessible debug information from Codeview. For example, without this flag the metadata for a non-trivial C++ record with user-defined ctor and a trivial one with a defaulted ctor are the same. struct S { S(); } struct S { S() = default; } This change introduces a new DI flag and corresponding clang::CXXRecordDecl::isTrivial method to set the flag in the frontend. Reviewers: rnk, zturner, llvm-commits, dblaikie, aleksandr.urakov, deadalnix Reviewed By: rnk Subscribers: asmith, probinson, aprantl, JDevlieghere Differential Revision: https://reviews.llvm.org/D45122 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337641 91177308-0d34-0410-b5e6-96231b3b80d8 Aaron Smith 1 year, 1 month ago
2 changed file(s) with 5 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4646 HANDLE_DI_FLAG((1 << 23), TypePassByReference)
4747 HANDLE_DI_FLAG((1 << 24), FixedEnum)
4848 HANDLE_DI_FLAG((1 << 25), Thunk)
49 HANDLE_DI_FLAG((1 << 26), Trivial)
4950
5051 // To avoid needing a dedicated value for IndirectVirtualBase, we use
5152 // the bitwise or of Virtual and FwdDecl, which does not otherwise
5556 #ifdef DI_FLAG_LARGEST_NEEDED
5657 // intended to be used with ADT/BitmaskEnum.h
5758 // NOTE: always must be equal to largest flag, check this when adding new flag
58 HANDLE_DI_FLAG((1 << 25), Largest)
59 HANDLE_DI_FLAG((1 << 26), Largest)
5960 #undef DI_FLAG_LARGEST_NEEDED
6061 #endif
6162
5353 LLVMDIFlagMainSubprogram = 1 << 21,
5454 LLVMDIFlagTypePassByValue = 1 << 22,
5555 LLVMDIFlagTypePassByReference = 1 << 23,
56 LLVMDIFlagFixedEnum = 1 << 24,
57 LLVMDIFlagThunk = 1 << 25,
58 LLVMDIFlagTrivial = 1 << 26,
5659 LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5),
5760 LLVMDIFlagAccessibility = LLVMDIFlagPrivate | LLVMDIFlagProtected |
5861 LLVMDIFlagPublic,