From 003f5519129e5413768b3d6a309f36389f425ced Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Fri, 23 Aug 2013 18:36:18 +0000 Subject: [PATCH] DebugInfoFinder: handle template params of a DISubprogram. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189131 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/DebugInfo.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index cffc2ac1f22..de3360129a5 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -1005,6 +1005,19 @@ void DebugInfoFinder::processSubprogram(DISubprogram SP) { return; processScope(SP.getContext()); processType(SP.getType()); + DIArray TParams = SP.getTemplateParams(); + for (unsigned I = 0, E = TParams.getNumElements(); I != E; ++I) { + DIDescriptor Element = TParams.getElement(I); + if (Element.isTemplateTypeParameter()) { + DITemplateTypeParameter TType(Element); + processScope(TType.getContext()); + processType(TType.getType()); + } else if (Element.isTemplateValueParameter()) { + DITemplateValueParameter TVal(Element); + processScope(TVal.getContext()); + processType(TVal.getType()); + } + } } /// processDeclare - Process DbgDeclareInst. -- 2.34.1