diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-09-09 19:23:58 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-09-09 19:23:58 +0000 |
commit | 33796c5e98ede9afc108580d2e02df61ea7dffb2 (patch) | |
tree | 20cbebd09d83d40e402959b698f372c6537eefd6 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 67de33b0757a1c0588b2351e1a045d7dde134bf3 (diff) | |
download | bcm5719-llvm-33796c5e98ede9afc108580d2e02df61ea7dffb2.tar.gz bcm5719-llvm-33796c5e98ede9afc108580d2e02df61ea7dffb2.zip |
Debug Info: move DIScope::getContext to DwarfDebug.
DIScope::getContext is a wrapper function that calls the specific getContext
method on each subclass. When we switch DIType::getContext to return DIScopeRef
instead of DIScope, DIScope::getContext can no longer return a DIScope without
a type identifier map.
DIScope::getContext is only used by DwarfDebug, so we move it to DwarfDebug
to have easy access to the type identifier map.
llvm-svn: 190330
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 6ec68834cf2..f9ce5918335 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -913,19 +913,19 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) { /// Return true if the type is appropriately scoped to be contained inside /// its own type unit. -static bool isTypeUnitScoped(DIType Ty) { +static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) { DIScope Parent = Ty.getContext(); while (Parent) { // Don't generate a hash for anything scoped inside a function. if (Parent.isSubprogram()) return false; - Parent = Parent.getContext(); + Parent = DD->getScopeContext(Parent); } return true; } /// Return true if the type should be split out into a type unit. -static bool shouldCreateTypeUnit(DICompositeType CTy) { +static bool shouldCreateTypeUnit(DICompositeType CTy, const DwarfDebug *DD) { uint16_t Tag = CTy.getTag(); switch (Tag) { @@ -936,7 +936,7 @@ static bool shouldCreateTypeUnit(DICompositeType CTy) { // If this is a class, structure, union, or enumeration type // that is not a declaration, is a type definition, and not scoped // inside a function then separate this out as a type unit. - if (CTy.isForwardDecl() || !isTypeUnitScoped(CTy)) + if (CTy.isForwardDecl() || !isTypeUnitScoped(CTy, DD)) return 0; return 1; default: @@ -1138,7 +1138,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) { } // If this is a type applicable to a type unit it then add it to the // list of types we'll compute a hash for later. - if (shouldCreateTypeUnit(CTy)) + if (shouldCreateTypeUnit(CTy, DD)) DD->addTypeUnitType(&Buffer); } |