From f2053af82caeaebd5ddce1b45c148be80d8f326a Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 28 Aug 2013 23:06:52 +0000 Subject: DebugInfo: Further fix/improvements to r189494 (and LLVM r189495). Selfhosting was crashing with the same type of problem but involving template specializations. llvm-svn: 189530 --- clang/lib/CodeGen/CGDebugInfo.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 42e648d79cf..e7d70660f6c 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1140,6 +1140,16 @@ CollectCXXMemberFunctions(const CXXRecordDecl *RD, llvm::DIFile Unit, EltTys.push_back(CreateCXXMemberFunction(Method, Unit, RecordTy)); } else EltTys.push_back(MI->second); + } else if (const FunctionTemplateDecl *FTD = dyn_cast(*I)) { + // Add any template specializations that have already been seen. Like + // implicit member functions, these may have been added to a declaration + // in the case of vtable-based debug info reduction. + for (FunctionTemplateDecl::spec_iterator SI = FTD->spec_begin(), SE = FTD->spec_end(); SI != SE; ++SI) { + llvm::DenseMap::iterator MI = + SPCache.find(cast(*SI)->getCanonicalDecl()); + if (MI != SPCache.end()) + EltTys.push_back(MI->second); + } } } } -- cgit v1.2.3