diff options
author | Devang Patel <dpatel@apple.com> | 2011-05-31 23:30:30 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-05-31 23:30:30 +0000 |
commit | 1cb8ab456c99065228c5cc22becad66eb4976d71 (patch) | |
tree | dac9c43e547bb9cd6d032f27e9aaeb673e81fc75 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 4533dada397fa4016a83b23fd3eb51555d47b147 (diff) | |
download | bcm5719-llvm-1cb8ab456c99065228c5cc22becad66eb4976d71.tar.gz bcm5719-llvm-1cb8ab456c99065228c5cc22becad66eb4976d71.zip |
Refactor.
llvm-svn: 132373
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 5016c43aebe..f128308fb6d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -609,10 +609,16 @@ void CompileUnit::addType(DIE *Entity, DIType Ty) { // If this is a complete composite type then include it in the // 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(); if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl() && (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace())) - addGlobalType(Ty.getName(), Entry->getEntry()); + GlobalTypes[Ty.getName()] = Die; } /// addPubTypes - Add type for pubtypes section. @@ -627,12 +633,7 @@ void CompileUnit::addPubTypes(DISubprogram SP) { DIType ATy(Args.getElement(i)); if (!ATy.Verify()) continue; - DICompositeType CATy = getDICompositeType(ATy); - if (DIDescriptor(CATy).Verify() && !CATy.getName().empty() - && !CATy.isForwardDecl()) { - if (DIEEntry *Entry = getDIEEntry(CATy)) - addGlobalType(CATy.getName(), Entry->getEntry()); - } + addGlobalType(ATy, getDIEEntry(ATy)->getEntry()); } } |