r350636 - Don't emit DW_AT_enum_class unless it's actually an 'enum class'.

Paul Robinson via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 8 08:28:11 PST 2019


Author: probinson
Date: Tue Jan  8 08:28:11 2019
New Revision: 350636

URL: http://llvm.org/viewvc/llvm-project?rev=350636&view=rev
Log:
Don't emit DW_AT_enum_class unless it's actually an 'enum class'.

Finishes off the functional part of PR36168.

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

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=350636&r1=350635&r2=350636&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Jan  8 08:28:11 2019
@@ -2711,7 +2711,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDef
   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,

Modified: cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp?rev=350636&r1=350635&r2=350636&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp Tue Jan  8 08:28:11 2019
@@ -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"




More information about the cfe-commits mailing list