summaryrefslogtreecommitdiff
path: root/lib/Analysis/DIBuilder.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-12-08 20:18:20 +0000
committerDevang Patel <dpatel@apple.com>2010-12-08 20:18:20 +0000
commit0a2551de2c61b372d45b236b413a5d2e15225c0f (patch)
tree5984b9921eb18f8cedf78f29fcf7075f0252a0f3 /lib/Analysis/DIBuilder.cpp
parentf4f39d35cd30073362c04ab5c37dda6d646d4b0b (diff)
downloadllvm-0a2551de2c61b372d45b236b413a5d2e15225c0f.tar.gz
llvm-0a2551de2c61b372d45b236b413a5d2e15225c0f.tar.bz2
llvm-0a2551de2c61b372d45b236b413a5d2e15225c0f.tar.xz
Add support to create class type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DIBuilder.cpp')
-rw-r--r--lib/Analysis/DIBuilder.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Analysis/DIBuilder.cpp b/lib/Analysis/DIBuilder.cpp
index c9a4229db4..658b3774af 100644
--- a/lib/Analysis/DIBuilder.cpp
+++ b/lib/Analysis/DIBuilder.cpp
@@ -236,6 +236,32 @@ DIType DIBuilder::CreateMemberType(StringRef Name,
return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
}
+/// CreateClassType - Create debugging information entry for a class.
+DIType DIBuilder::CreateClassType(DIDescriptor Context, StringRef Name,
+ DIFile File, unsigned LineNumber,
+ uint64_t SizeInBits, uint64_t AlignInBits,
+ uint64_t OffsetInBits, unsigned Flags,
+ DIType DerivedFrom, DIArray Elements,
+ MDNode *VTableHoder) {
+ // TAG_class_type is encoded in DICompositeType format.
+ Value *Elts[] = {
+ GetTagConstant(VMContext, dwarf::DW_TAG_class_type),
+ Context,
+ MDString::get(VMContext, Name),
+ File,
+ ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
+ ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
+ ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
+ ConstantInt::get(Type::getInt32Ty(VMContext), OffsetInBits),
+ ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
+ DerivedFrom,
+ Elements,
+ ConstantInt::get(Type::getInt32Ty(VMContext), 0),
+ VTableHoder
+ };
+ return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
+}
+
/// CreateStructType - Create debugging information entry for a struct.
DIType DIBuilder::CreateStructType(DIDescriptor Context, StringRef Name,
DIFile File, unsigned LineNumber,