diff options
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-rw-r--r-- | lib/IR/DebugInfo.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index f63fa1a22d..9d88ce0e50 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -847,6 +847,15 @@ bool llvm::isSubprogramContext(const MDNode *Context) { // DebugInfoFinder implementations. //===----------------------------------------------------------------------===// +void DebugInfoFinder::reset() { + CUs.clear(); + SPs.clear(); + GVs.clear(); + TYs.clear(); + Scopes.clear(); + NodesSeen.clear(); +} + /// processModule - Process entire module and collect debug info. void DebugInfoFinder::processModule(const Module &M) { if (NamedMDNode *CU_Nodes = M.getNamedMetadata("llvm.dbg.cu")) { @@ -970,6 +979,19 @@ void DebugInfoFinder::processDeclare(const DbgDeclareInst *DDI) { processType(DIVariable(N).getType()); } +void DebugInfoFinder::processValue(const DbgValueInst *DVI) { + MDNode *N = dyn_cast<MDNode>(DVI->getVariable()); + if (!N) return; + + DIDescriptor DV(N); + if (!DV.isVariable()) + return; + + if (!NodesSeen.insert(DV)) + return; + processType(DIVariable(N).getType()); +} + /// addType - Add type into Tys. bool DebugInfoFinder::addType(DIType DT) { if (!DT.isValid()) |