From: David Majnemer Date: Wed, 6 Jul 2016 21:07:42 +0000 (+0000) Subject: [CodeView] Unions are always sealed X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc3da7f637666cdb26e619479d490ba073b93182;p=llvm [CodeView] Unions are always sealed It is impossible to inherit from a union. We are missing a way to represent this in IR for classes/structs... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274675 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index fe63b7043c5..cb4310836dd 100644 --- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1536,7 +1536,7 @@ TypeIndex CodeViewDebug::lowerTypeUnion(const DICompositeType *Ty) { } TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) { - ClassOptions CO = getCommonClassOptions(Ty); + ClassOptions CO = ClassOptions::Sealed | getCommonClassOptions(Ty); TypeIndex FieldTI; unsigned FieldCount; bool ContainsNestedClass; diff --git a/test/DebugInfo/COFF/types-data-members.ll b/test/DebugInfo/COFF/types-data-members.ll index 70a509714b6..759a5e54644 100644 --- a/test/DebugInfo/COFF/types-data-members.ll +++ b/test/DebugInfo/COFF/types-data-members.ll @@ -161,8 +161,9 @@ ; CHECK: Union (0x100B) { ; CHECK: TypeLeafKind: LF_UNION (0x1506) ; CHECK: MemberCount: 2 -; CHECK: Properties [ (0x200) +; CHECK: Properties [ (0x600) ; CHECK: HasUniqueName (0x200) +; CHECK: Sealed (0x400) ; CHECK: ] ; CHECK: FieldList: (0x100A) ; CHECK: SizeOf: 4