Emit debug info for virtual functions.

llvm-svn: 94467
This commit is contained in:
Devang Patel 2010-01-25 23:17:15 +00:00
parent 5cb5287467
commit 7af03fb4f0
1 changed files with 12 additions and 2 deletions

View File

@ -562,14 +562,24 @@ CollectCXXMemberFunctions(const CXXRecordDecl *Decl,
MethodLine = PLoc.getLine();
}
// Collect virtual method info.
llvm::DIType ContainingType;
unsigned Virtuality = 0;
unsigned VIndex = 0;
if (Method->isVirtual()) {
// FIXME: Identify pure virtual functions.
Virtuality = llvm::dwarf::DW_VIRTUALITY_virtual;
VIndex = CGM.getVtableInfo().getMethodVtableIndex(Method);
ContainingType = RecordTy;
}
llvm::DISubprogram SP =
DebugFactory.CreateSubprogram(RecordTy , MethodName, MethodName,
MethodLinkageName,
MethodDefUnit, MethodLine,
MethodTy, false,
Method->isThisDeclarationADefinition(),
0 /*Virtuality*/, 0 /*VIndex*/,
llvm::DIType() /*ContainingType*/);
Virtuality, VIndex, ContainingType);
if (Method->isThisDeclarationADefinition())
SPCache[cast<FunctionDecl>(Method)] = llvm::WeakVH(SP.getNode());
EltTys.push_back(SP);