diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-08-01 20:30:22 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-08-01 20:30:22 +0000 |
commit | c8b93557da150e051c273701652a2db328708708 (patch) | |
tree | a7c3cc785ee9c8961e8b7e279cbef22083c74a0b /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 70cf72e0927ca4e648d9d70b3c309bdaa700a386 (diff) | |
download | external_llvm-c8b93557da150e051c273701652a2db328708708.zip external_llvm-c8b93557da150e051c273701652a2db328708708.tar.gz external_llvm-c8b93557da150e051c273701652a2db328708708.tar.bz2 |
DebugInfo: Emit definitions for types with no members.
The absence of members was a poor/incorrect proxy for "is definition".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index e912076..df8ca17 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -980,16 +980,12 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) { case dwarf::DW_TAG_structure_type: case dwarf::DW_TAG_union_type: case dwarf::DW_TAG_class_type: { - // Add elements to structure type. - DIArray Elements = CTy.getTypeArray(); - - // A forward struct declared type may not have elements available. - unsigned N = Elements.getNumElements(); - if (N == 0) + if (CTy.isForwardDecl()) break; // Add elements to structure type. - for (unsigned i = 0; i < N; ++i) { + DIArray Elements = CTy.getTypeArray(); + for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); DIE *ElemDie = NULL; if (Element.isSubprogram()) { |