]> granicus.if.org Git - clang/commitdiff
Don't emit DW_AT_enum_class unless it's actually an 'enum class'.
authorPaul Robinson <paul.robinson@sony.com>
Tue, 8 Jan 2019 16:28:11 +0000 (16:28 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Tue, 8 Jan 2019 16:28:11 +0000 (16:28 +0000)
Finishes off the functional part of PR36168.

Differential Revision: https://reviews.llvm.org/D56393

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350636 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info-enum-class.cpp

index f3a07a30eb05336c0be26149736c6eeeae345fd4..7ebbfbe2ff68e7df87346419145a5c85574ab01b 100644 (file)
@@ -2711,7 +2711,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const EnumType *Ty) {
   llvm::DIType *ClassTy = getOrCreateType(ED->getIntegerType(), DefUnit);
   return DBuilder.createEnumerationType(EnumContext, ED->getName(), DefUnit,
                                         Line, Size, Align, EltArray, ClassTy,
-                                        Identifier, ED->isFixed());
+                                        Identifier, ED->isScoped());
 }
 
 llvm::DIMacro *CGDebugInfo::CreateMacro(llvm::DIMacroFile *Parent,
index e857bb1959133b993b86ff18b9380f4829bab4f3..664fbb74a8b473c95871fbb730981172a91c9450 100644 (file)
@@ -52,6 +52,7 @@ namespace test2 {
 // FIXME: this should just be a declaration under -fno-standalone-debug
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "E"
 // CHECK-SAME:             scope: [[TEST2:![0-9]+]]
+// CHECK-NOT:              DIFlagFixedEnum
 // CHECK-SAME:             elements: [[TEST_ENUMS:![0-9]+]]
 // CHECK-SAME:             identifier: "_ZTSN5test21EE"
 // CHECK: [[TEST2]] = !DINamespace(name: "test2"
@@ -67,6 +68,7 @@ namespace test3 {
 // FIXME: this should just be a declaration under -fno-standalone-debug
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "E"
 // CHECK-SAME:             scope: [[TEST3:![0-9]+]]
+// CHECK-NOT:              DIFlagFixedEnum
 // CHECK-SAME:             elements: [[TEST_ENUMS]]
 // CHECK-SAME:             identifier: "_ZTSN5test31EE"
 // CHECK: [[TEST3]] = !DINamespace(name: "test3"
@@ -78,6 +80,7 @@ void func(E *) {
 namespace test4 {
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "E"
 // CHECK-SAME:             scope: [[TEST4:![0-9]+]]
+// CHECK-NOT:              DIFlagFixedEnum
 // CHECK-SAME:             elements: [[TEST_ENUMS]]
 // CHECK-SAME:             identifier: "_ZTSN5test41EE"
 // CHECK: [[TEST4]] = !DINamespace(name: "test4"