Use addFlag to add the enum class attribute.
authorEric Christopher <echristo@gmail.com>
Fri, 4 Oct 2013 22:40:10 +0000 (22:40 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 4 Oct 2013 22:40:10 +0000 (22:40 +0000)
This has the side effect of using DW_FORM_flag_present on dwarf4 and above.

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

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
test/DebugInfo/X86/enum-class.ll

index a487b10aa8364bda96c49a1ab53a5e57c6b375db..3ff6d68a22deb4d8aec686d155ca2971b9f1fef2 100644 (file)
@@ -1014,7 +1014,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
     DIType DTy = CTy.getTypeDerivedFrom();
     if (DTy) {
       addType(&Buffer, DTy);
-      addUInt(&Buffer, dwarf::DW_AT_enum_class, dwarf::DW_FORM_flag, 1);
+      addFlag(&Buffer, dwarf::DW_AT_enum_class);
     }
   }
     break;
index 8b2fbb701eb3acb5e2c16e6a2f4775042795c30c..96aefe228be1f8635b2f95e0745a8df3c5b1a6b1 100644 (file)
 
 ; CHECK: DW_TAG_enumeration_type [3]
 ; CHECK: DW_AT_type [DW_FORM_ref4]
-; CHECK: DW_AT_enum_class [DW_FORM_flag]    (0x01)
+; CHECK: DW_AT_enum_class [DW_FORM_flag_present] (true)
 ; CHECK: DW_AT_name [DW_FORM_strp]      ( .debug_str[{{.*}}] = "A")
 
 ; CHECK: DW_TAG_enumeration_type [3] *
 ; CHECK: DW_AT_type [DW_FORM_ref4]
-; CHECK: DW_AT_enum_class [DW_FORM_flag]    (0x01)
+; CHECK: DW_AT_enum_class [DW_FORM_flag_present] (true)
 ; CHECK: DW_AT_name [DW_FORM_strp]          ( .debug_str[{{.*}}] = "B")
 
 ; CHECK: DW_TAG_enumeration_type [6]