summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorAaron Smith <aaron.smith@microsoft.com>2018-07-21 05:42:13 +0000
committerAaron Smith <aaron.smith@microsoft.com>2018-07-21 05:42:13 +0000
commit23c2d1c15a9c89f313304c22180fb5cae97211bc (patch)
tree4f1fa70b6878fdf3cbe484328943e1826688a1e9 /llvm/include
parenta052206c4b863aa951d46060308e399a45c81780 (diff)
downloadbcm5719-llvm-23c2d1c15a9c89f313304c22180fb5cae97211bc.tar.gz
bcm5719-llvm-23c2d1c15a9c89f313304c22180fb5cae97211bc.zip
[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 llvm-svn: 337641
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm-c/DebugInfo.h3
-rw-r--r--llvm/include/llvm/IR/DebugInfoFlags.def3
2 files changed, 5 insertions, 1 deletions
diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h
index dc1578f4862..cee6755f187 100644
--- a/llvm/include/llvm-c/DebugInfo.h
+++ b/llvm/include/llvm-c/DebugInfo.h
@@ -54,6 +54,9 @@ typedef enum {
LLVMDIFlagMainSubprogram = 1 << 21,
LLVMDIFlagTypePassByValue = 1 << 22,
LLVMDIFlagTypePassByReference = 1 << 23,
+ LLVMDIFlagFixedEnum = 1 << 24,
+ LLVMDIFlagThunk = 1 << 25,
+ LLVMDIFlagTrivial = 1 << 26,
LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5),
LLVMDIFlagAccessibility = LLVMDIFlagPrivate | LLVMDIFlagProtected |
LLVMDIFlagPublic,
diff --git a/llvm/include/llvm/IR/DebugInfoFlags.def b/llvm/include/llvm/IR/DebugInfoFlags.def
index e3707d48754..b1f5fac6423 100644
--- a/llvm/include/llvm/IR/DebugInfoFlags.def
+++ b/llvm/include/llvm/IR/DebugInfoFlags.def
@@ -47,6 +47,7 @@ HANDLE_DI_FLAG((1 << 22), TypePassByValue)
HANDLE_DI_FLAG((1 << 23), TypePassByReference)
HANDLE_DI_FLAG((1 << 24), FixedEnum)
HANDLE_DI_FLAG((1 << 25), Thunk)
+HANDLE_DI_FLAG((1 << 26), Trivial)
// To avoid needing a dedicated value for IndirectVirtualBase, we use
// the bitwise or of Virtual and FwdDecl, which does not otherwise
@@ -56,7 +57,7 @@ HANDLE_DI_FLAG((1 << 2) | (1 << 5), IndirectVirtualBase)
#ifdef DI_FLAG_LARGEST_NEEDED
// intended to be used with ADT/BitmaskEnum.h
// NOTE: always must be equal to largest flag, check this when adding new flag
-HANDLE_DI_FLAG((1 << 25), Largest)
+HANDLE_DI_FLAG((1 << 26), Largest)
#undef DI_FLAG_LARGEST_NEEDED
#endif
OpenPOWER on IntegriCloud