summaryrefslogtreecommitdiff
path: root/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-12-03 19:11:07 +0000
committerDevang Patel <dpatel@apple.com>2009-12-03 19:11:07 +0000
commit5d11eb0ed54116b7f33507999617661fb2ae99df (patch)
tree5ed561302e3a79e3303515edf0be0321684203e0 /lib/Analysis/DebugInfo.cpp
parent018402d30c30a04d10e0b1afbc2e5f4e1b84190d (diff)
downloadllvm-5d11eb0ed54116b7f33507999617661fb2ae99df.tar.gz
llvm-5d11eb0ed54116b7f33507999617661fb2ae99df.tar.bz2
llvm-5d11eb0ed54116b7f33507999617661fb2ae99df.tar.xz
Add support to emit debug info for virtual functions and virtual base classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r--lib/Analysis/DebugInfo.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index b1eff9efe1..4a012ce484 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -866,7 +866,9 @@ DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context,
DICompileUnit CompileUnit,
unsigned LineNo, DIType Type,
bool isLocalToUnit,
- bool isDefinition) {
+ bool isDefinition,
+ unsigned VK, unsigned VIndex,
+ DIType ContainingType) {
Value *Elts[] = {
GetTagConstant(dwarf::DW_TAG_subprogram),
@@ -879,9 +881,12 @@ DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
Type.getNode(),
ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit),
- ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition)
+ ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition),
+ ConstantInt::get(Type::getInt32Ty(VMContext), (unsigned)VK),
+ ConstantInt::get(Type::getInt32Ty(VMContext), VIndex),
+ ContainingType.getNode()
};
- return DISubprogram(MDNode::get(VMContext, &Elts[0], 11));
+ return DISubprogram(MDNode::get(VMContext, &Elts[0], 14));
}
/// CreateSubprogramDefinition - Create new subprogram descriptor for the
@@ -902,9 +907,12 @@ DISubprogram DIFactory::CreateSubprogramDefinition(DISubprogram &SPDeclaration)
DeclNode->getElement(7), // LineNo
DeclNode->getElement(8), // Type
DeclNode->getElement(9), // isLocalToUnit
- ConstantInt::get(Type::getInt1Ty(VMContext), true)
+ ConstantInt::get(Type::getInt1Ty(VMContext), true),
+ DeclNode->getElement(11), // Virtuality
+ DeclNode->getElement(12), // VIndex
+ DeclNode->getElement(13) // Containting Type
};
- return DISubprogram(MDNode::get(VMContext, &Elts[0], 11));
+ return DISubprogram(MDNode::get(VMContext, &Elts[0], 14));
}
/// CreateGlobalVariable - Create a new descriptor for the specified global.