aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-31 22:56:51 +0000
committerDevang Patel <dpatel@apple.com>2011-05-31 22:56:51 +0000
commite9ae06ca987b6c3b6cfbcd50ab85386565a4e0ca (patch)
tree303a1f3d2a27d5e97976df3ca914edaee0b56360 /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent7d866044f4a6c32af1bba2d31a7c8c09b6f7fb6e (diff)
Include global types, that are referenced through local variables, in debug_pubtypes list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 9e4a61d52f..5016c43aeb 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -605,8 +605,14 @@ void CompileUnit::addType(DIE *Entity, DIType Ty) {
// Set up proxy.
Entry = createDIEEntry(Buffer);
insertDIEEntry(Ty, Entry);
-
Entity->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, Entry);
+
+ // If this is a complete composite type then include it in the
+ // list of global types.
+ DIDescriptor Context = Ty.getContext();
+ if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
+ && (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace()))
+ addGlobalType(Ty.getName(), Entry->getEntry());
}
/// addPubTypes - Add type for pubtypes section.