From e9853f25ad8a9e5bcde1cebb776b9b148ebd7919 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 31 May 2011 22:56:51 +0000 Subject: Include global types, that are referenced through local variables, in debug_pubtypes list. llvm-svn: 132371 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 9e4a61d52f6..5016c43aebe 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/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. -- cgit v1.2.3