diff options
author | Devang Patel <dpatel@apple.com> | 2011-05-31 22:56:51 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-05-31 22:56:51 +0000 |
commit | e9853f25ad8a9e5bcde1cebb776b9b148ebd7919 (patch) | |
tree | d5d35e2c7a85b453cf8236e74597b102d5fc9495 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 72140d553a9c451b8ab1944b6628c83fafd3b149 (diff) | |
download | bcm5719-llvm-e9853f25ad8a9e5bcde1cebb776b9b148ebd7919.tar.gz bcm5719-llvm-e9853f25ad8a9e5bcde1cebb776b9b148ebd7919.zip |
Include global types, that are referenced through local variables, in debug_pubtypes list.
llvm-svn: 132371
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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. |