summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-08-01 20:30:22 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-08-01 20:30:22 +0000
commita1ae0e6ecbfae762da1a10652090d7ae9c8c9df1 (patch)
treef2c7d6524e7e41c0945526625b0b2ab781e54c09 /llvm/lib
parentd0b09c42a3bd42da7f2c9abe688c7f38ef48f0bf (diff)
downloadbcm5719-llvm-a1ae0e6ecbfae762da1a10652090d7ae9c8c9df1.tar.gz
bcm5719-llvm-a1ae0e6ecbfae762da1a10652090d7ae9c8c9df1.zip
DebugInfo: Emit definitions for types with no members.
The absence of members was a poor/incorrect proxy for "is definition". llvm-svn: 187607
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index e912076a65b..df8ca170ac1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/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()) {
OpenPOWER on IntegriCloud