@@ -1733,8 +1733,8 @@ class DwarfDebug : public Dwarf {
1733
1733
1734
1734
// Add source line info if available and TyDesc is not a forward
1735
1735
// declaration.
1736
- // FIXME - Enable this. if (!DTy.isForwardDecl())
1737
- // FIXME - Enable this. AddSourceLine(&Buffer, * DTy);
1736
+ if (!DTy.isForwardDecl ())
1737
+ AddSourceLine (&Buffer, & DTy);
1738
1738
}
1739
1739
1740
1740
// / ConstructTypeDIE - Construct type DIE from DICompositeType.
@@ -1815,20 +1815,23 @@ class DwarfDebug : public Dwarf {
1815
1815
// Add name if not anonymous or intermediate type.
1816
1816
if (!Name.empty ()) AddString (&Buffer, DW_AT_name, DW_FORM_string, Name);
1817
1817
1818
- // Add size if non-zero (derived types might be zero-sized.)
1819
- if (Size)
1820
- AddUInt (&Buffer, DW_AT_byte_size, 0 , Size);
1821
- else {
1822
- // Add zero size if it is not a forward declaration.
1823
- if (CTy.isForwardDecl ())
1824
- AddUInt (&Buffer, DW_AT_declaration, DW_FORM_flag, 1 );
1825
- else
1826
- AddUInt (&Buffer, DW_AT_byte_size, 0 , 0 );
1818
+ if (Tag == DW_TAG_enumeration_type || Tag == DW_TAG_structure_type
1819
+ || Tag == DW_TAG_union_type) {
1820
+ // Add size if non-zero (derived types might be zero-sized.)
1821
+ if (Size)
1822
+ AddUInt (&Buffer, DW_AT_byte_size, 0 , Size);
1823
+ else {
1824
+ // Add zero size if it is not a forward declaration.
1825
+ if (CTy.isForwardDecl ())
1826
+ AddUInt (&Buffer, DW_AT_declaration, DW_FORM_flag, 1 );
1827
+ else
1828
+ AddUInt (&Buffer, DW_AT_byte_size, 0 , 0 );
1829
+ }
1830
+
1831
+ // Add source line info if available.
1832
+ if (!CTy.isForwardDecl ())
1833
+ AddSourceLine (&Buffer, &CTy);
1827
1834
}
1828
-
1829
- // Add source line info if available.
1830
- if (!CTy.isForwardDecl ())
1831
- AddSourceLine (&Buffer, &CTy);
1832
1835
}
1833
1836
1834
1837
// ConstructSubrangeDIE - Construct subrange DIE from DISubrange.
@@ -1853,7 +1856,6 @@ class DwarfDebug : public Dwarf {
1853
1856
AddUInt (&Buffer, DW_AT_GNU_vector, DW_FORM_flag, 1 );
1854
1857
1855
1858
DIArray Elements = CTy->getTypeArray ();
1856
- AddType (DW_Unit, &Buffer, CTy->getTypeDerivedFrom ());
1857
1859
1858
1860
// Construct an anonymous type for index type.
1859
1861
DIE IdxBuffer (DW_TAG_base_type);
@@ -1906,7 +1908,7 @@ class DwarfDebug : public Dwarf {
1906
1908
1907
1909
AddSourceLine (MemberDie, &DT);
1908
1910
1909
- AddUInt (MemberDie, DW_AT_bit_size, 0 , DT. getSizeInBits ());
1911
+ // FIXME _ Handle bitfields
1910
1912
DIEBlock *Block = new DIEBlock ();
1911
1913
AddUInt (Block, 0 , DW_FORM_data1, DW_OP_plus_uconst);
1912
1914
AddUInt (Block, 0 , DW_FORM_udata, DT.getOffsetInBits () >> 3 );
0 commit comments