Refactor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2011-05-31 23:30:30 +00:00
parent e9ae06ca98
commit 66658e4dff
2 changed files with 9 additions and 10 deletions

View File

@ -609,10 +609,16 @@ void CompileUnit::addType(DIE *Entity, DIType Ty) {
// If this is a complete composite type then include it in the // If this is a complete composite type then include it in the
// list of global types. // list of global types.
addGlobalType(Ty, Entry->getEntry());
}
/// addGlobalType - Add a new global type to the compile unit.
///
void CompileUnit::addGlobalType(DIType Ty, DIE *Die) {
DIDescriptor Context = Ty.getContext(); DIDescriptor Context = Ty.getContext();
if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl() if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
&& (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace())) && (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace()))
addGlobalType(Ty.getName(), Entry->getEntry()); GlobalTypes[Ty.getName()] = Die;
} }
/// addPubTypes - Add type for pubtypes section. /// addPubTypes - Add type for pubtypes section.
@ -627,12 +633,7 @@ void CompileUnit::addPubTypes(DISubprogram SP) {
DIType ATy(Args.getElement(i)); DIType ATy(Args.getElement(i));
if (!ATy.Verify()) if (!ATy.Verify())
continue; continue;
DICompositeType CATy = getDICompositeType(ATy); addGlobalType(ATy, getDIEEntry(ATy)->getEntry());
if (DIDescriptor(CATy).Verify() && !CATy.getName().empty()
&& !CATy.isForwardDecl()) {
if (DIEEntry *Entry = getDIEEntry(CATy))
addGlobalType(CATy.getName(), Entry->getEntry());
}
} }
} }

View File

@ -87,9 +87,7 @@ public:
/// addGlobalType - Add a new global type to the compile unit. /// addGlobalType - Add a new global type to the compile unit.
/// ///
void addGlobalType(StringRef Name, DIE *Die) { void addGlobalType(DIType Ty, DIE *Die);
GlobalTypes[Name] = Die;
}
/// getDIE - Returns the debug information entry map slot for the /// getDIE - Returns the debug information entry map slot for the
/// specified debug variable. /// specified debug variable.