1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

Include global types, that are referenced through local variables, in debug_pubtypes list.

llvm-svn: 132371
This commit is contained in:
Devang Patel 2011-05-31 22:56:51 +00:00
parent 1f27999aaa
commit a9f6a46390
2 changed files with 8 additions and 7 deletions

View File

@ -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.

View File

@ -985,12 +985,7 @@ void DwarfDebug::constructGlobalVariableDIE(const MDNode *N) {
getRealLinkageName(LinkageName));
// Add type.
TheCU->addType(VariableDIE, GTy);
if (GTy.isCompositeType() && !GTy.getName().empty()
&& !GTy.isForwardDecl()) {
DIEEntry *Entry = TheCU->getDIEEntry(GTy);
assert(Entry && "Missing global type!");
TheCU->addGlobalType(GTy.getName(), Entry->getEntry());
}
// Add scoping info.
if (!GV.isLocalToUnit()) {
TheCU->addUInt(VariableDIE, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1);