aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-01-25 23:17:15 +0000
committerDevang Patel <dpatel@apple.com>2010-01-25 23:17:15 +0000
commitc002464ae56bbd069cb0c204ce2b766c7ae5063a (patch)
treed42c3fa5b21f6abf9888ec5698e29c30328c96ae /lib/CodeGen/CGDebugInfo.cpp
parent841d5e607f81bf5627e47d0c62ead29f28b5b0c2 (diff)
Emit debug info for virtual functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 5768e5b4db..2b03d2c603 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -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);