forked from OSchip/llvm-project
Tie constructor defintion with its declaration using AT_specification.
llvm-svn: 130561
This commit is contained in:
parent
4105ed1523
commit
a3e3fded0a
|
@ -772,10 +772,7 @@ CGDebugInfo::CreateCXXMemberFunction(const CXXMethodDecl *Method,
|
||||||
Virtuality, VIndex, ContainingType,
|
Virtuality, VIndex, ContainingType,
|
||||||
Flags, CGM.getLangOptions().Optimize);
|
Flags, CGM.getLangOptions().Optimize);
|
||||||
|
|
||||||
// Don't cache ctors or dtors since we have to emit multiple functions for
|
SPCache[Method] = llvm::WeakVH(SP);
|
||||||
// a single ctor or dtor.
|
|
||||||
if (!IsCtorOrDtor)
|
|
||||||
SPCache[Method] = llvm::WeakVH(SP);
|
|
||||||
|
|
||||||
return SP;
|
return SP;
|
||||||
}
|
}
|
||||||
|
@ -1592,6 +1589,14 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) {
|
||||||
// Setup context.
|
// Setup context.
|
||||||
getContextDescriptor(cast<Decl>(D->getDeclContext()));
|
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(),
|
for (FunctionDecl::redecl_iterator I = FD->redecls_begin(),
|
||||||
E = FD->redecls_end(); I != E; ++I) {
|
E = FD->redecls_end(); I != E; ++I) {
|
||||||
const FunctionDecl *NextFD = *I;
|
const FunctionDecl *NextFD = *I;
|
||||||
|
|
Loading…
Reference in New Issue