DebugInfo: Gut DINamespace and DITemplate*Parameter

Continue gutting `DIDescriptor` subclasses, turning them into
as-bare-as-possible pointer wrappers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-14 03:01:27 +00:00
parent 32cb99437e
commit 41ed49389b
4 changed files with 54 additions and 73 deletions

View File

@@ -30,10 +30,10 @@ struct BreakpointPrinter : public ModulePass {
BreakpointPrinter(raw_ostream &out) : ModulePass(ID), Out(out) {}
void getContextName(DIDescriptor Context, std::string &N) {
if (DINameSpace NS = dyn_cast<MDNamespace>(Context)) {
if (!NS.getName().empty()) {
getContextName(NS.getContext(), N);
N = N + NS.getName().str() + "::";
if (auto *NS = dyn_cast<MDNamespace>(Context)) {
if (!NS->getName().empty()) {
getContextName(NS->getScope(), N);
N = N + NS->getName().str() + "::";
}
} else if (DIType TY = dyn_cast<MDType>(Context)) {
if (!TY.getName().empty()) {