diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-23 21:08:00 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-23 21:08:00 +0000 |
| commit | a59d3e5af889662139b8b08f2175f12567491441 (patch) | |
| tree | c91b05e3c724401c8bf6bcbf8ff3bdfd80450ef3 /llvm/tools/opt/BreakpointPrinter.cpp | |
| parent | dc88bd6e1fc483d6927604e6b2dc58f9d4d06316 (diff) | |
| download | bcm5719-llvm-a59d3e5af889662139b8b08f2175f12567491441.tar.gz bcm5719-llvm-a59d3e5af889662139b8b08f2175f12567491441.zip | |
DebugInfo: Remove MDString-based type references
Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around
DIType*. It is no longer legal to refer to a DICompositeType by its
'identifier:', and DIBuilder no longer retains all types with an
'identifier:' automatically.
Aside from the bitcode upgrade, this is mainly removing logic to resolve
an MDString-based reference to an actualy DIType. The commits leading
up to this have made the implicit type map in DICompileUnit's
'retainedTypes:' field superfluous.
This does not remove DITypeRef, DIScopeRef, DINodeRef, and
DITypeRefArray, or stop using them in DI-related metadata. Although as
of this commit they aren't serving a useful purpose, there are patchces
under review to reuse them for CodeView support.
The tests in LLVM were updated with deref-typerefs.sh, which is attached
to the thread "[RFC] Lazy-loading of debug info metadata":
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html
llvm-svn: 267296
Diffstat (limited to 'llvm/tools/opt/BreakpointPrinter.cpp')
| -rw-r--r-- | llvm/tools/opt/BreakpointPrinter.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/tools/opt/BreakpointPrinter.cpp b/llvm/tools/opt/BreakpointPrinter.cpp index f76ad79fbe7..33b3edcd123 100644 --- a/llvm/tools/opt/BreakpointPrinter.cpp +++ b/llvm/tools/opt/BreakpointPrinter.cpp @@ -25,7 +25,6 @@ namespace { struct BreakpointPrinter : public ModulePass { raw_ostream &Out; static char ID; - DITypeIdentifierMap TypeIdentifierMap; BreakpointPrinter(raw_ostream &out) : ModulePass(ID), Out(out) {} @@ -37,16 +36,13 @@ struct BreakpointPrinter : public ModulePass { } } else if (auto *TY = dyn_cast<DIType>(Context)) { if (!TY->getName().empty()) { - getContextName(TY->getScope().resolve(TypeIdentifierMap), N); + getContextName(TY->getScope().resolve(), N); N = N + TY->getName().str() + "::"; } } } bool runOnModule(Module &M) override { - TypeIdentifierMap.clear(); - TypeIdentifierMap = generateDITypeIdentifierMap(M); - StringSet<> Processed; if (NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.sp")) for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { @@ -54,7 +50,7 @@ struct BreakpointPrinter : public ModulePass { auto *SP = cast_or_null<DISubprogram>(NMD->getOperand(i)); if (!SP) continue; - getContextName(SP->getScope().resolve(TypeIdentifierMap), Name); + getContextName(SP->getScope().resolve(), Name); Name = Name + SP->getDisplayName().str(); if (!Name.empty() && Processed.insert(Name).second) { Out << Name << "\n"; |

