summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-07-06 21:07:42 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-07-06 21:07:42 +0000
commite1e7372e939646c614fd03f37a267e287ffb8392 (patch)
tree2a15701bc4a072656ce5c97c584b2d277b8acf84
parent6f9d01bbd525aa9c5332975ec20547b3fdd338c2 (diff)
downloadbcm5719-llvm-e1e7372e939646c614fd03f37a267e287ffb8392.tar.gz
bcm5719-llvm-e1e7372e939646c614fd03f37a267e287ffb8392.zip
[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... llvm-svn: 274675
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp2
-rw-r--r--llvm/test/DebugInfo/COFF/types-data-members.ll3
2 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index fe63b7043c5..cb4310836dd 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/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/llvm/test/DebugInfo/COFF/types-data-members.ll b/llvm/test/DebugInfo/COFF/types-data-members.ll
index 70a509714b6..759a5e54644 100644
--- a/llvm/test/DebugInfo/COFF/types-data-members.ll
+++ b/llvm/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: <field list> (0x100A)
; CHECK: SizeOf: 4
OpenPOWER on IntegriCloud