summaryrefslogtreecommitdiffstats
path: root/clang/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
commit7af03fb4f0b9ab3856d71aaf87274d32c302686a (patch)
tree0f5092005dfe2bc414662fbea005dcb4909ce7c8 /clang/lib/CodeGen/CGDebugInfo.cpp
parent5cb528746786f29399f9a9db7bb89c1d0dd4f858 (diff)
downloadbcm5719-llvm-7af03fb4f0b9ab3856d71aaf87274d32c302686a.tar.gz
bcm5719-llvm-7af03fb4f0b9ab3856d71aaf87274d32c302686a.zip
Emit debug info for virtual functions.
llvm-svn: 94467
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 5768e5b4db5..2b03d2c603c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud