Virtuality, VIndex, ContainingType,
Flags, CGM.getLangOptions().Optimize);
- // Don't cache ctors or dtors since we have to emit multiple functions for
- // a single ctor or dtor.
- if (!IsCtorOrDtor)
- SPCache[Method] = llvm::WeakVH(SP);
+ SPCache[Method] = llvm::WeakVH(SP);
return SP;
}
// Setup context.
getContextDescriptor(cast<Decl>(D->getDeclContext()));
+ llvm::DenseMap<const FunctionDecl *, llvm::WeakVH>::iterator
+ MI = SPCache.find(FD);
+ if (MI != SPCache.end()) {
+ llvm::DISubprogram SP(dyn_cast_or_null<llvm::MDNode>(&*MI->second));
+ if (SP.isSubprogram() && !llvm::DISubprogram(SP).isDefinition())
+ return SP;
+ }
+
for (FunctionDecl::redecl_iterator I = FD->redecls_begin(),
E = FD->redecls_end(); I != E; ++I) {
const FunctionDecl *NextFD = *I;