]> granicus.if.org Git - llvm/commitdiff
[CodeView] Unions are always sealed
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 6 Jul 2016 21:07:42 +0000 (21:07 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 6 Jul 2016 21:07:42 +0000 (21:07 +0000)
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

lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
test/DebugInfo/COFF/types-data-members.ll

index fe63b7043c50a2a9740834f09ee9acde8d193636..cb4310836dd77626308f01196f8988a05c2c9db3 100644 (file)
@@ -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;
index 70a509714b69aef2038b8dfcee38f3a78b788c59..759a5e546446179dbd36c22e401a7736dedfb485 100644 (file)
 ; 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: <field list> (0x100A)
 ; CHECK:     SizeOf: 4