[llvm] r176004 - DIBuilder: support structs with vtable pointers in the same way as classes
David Blaikie
dblaikie at gmail.com
Sun Feb 24 17:07:18 PST 2013
Author: dblaikie
Date: Sun Feb 24 19:07:18 2013
New Revision: 176004
URL: http://llvm.org/viewvc/llvm-project?rev=176004&view=rev
Log:
DIBuilder: support structs with vtable pointers in the same way as classes
Modified:
llvm/trunk/include/llvm/DIBuilder.h
llvm/trunk/lib/IR/DIBuilder.cpp
Modified: llvm/trunk/include/llvm/DIBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DIBuilder.h?rev=176004&r1=176003&r2=176004&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DIBuilder.h (original)
+++ llvm/trunk/include/llvm/DIBuilder.h Sun Feb 24 19:07:18 2013
@@ -282,10 +282,12 @@ namespace llvm {
/// @param Flags Flags to encode member attribute, e.g. private
/// @param Elements Struct elements.
/// @param RunTimeLang Optional parameter, Objective-C runtime version.
- DIType createStructType(DIDescriptor Scope, StringRef Name, DIFile File,
- unsigned LineNumber, uint64_t SizeInBits,
- uint64_t AlignInBits, unsigned Flags,
- DIArray Elements, unsigned RunTimeLang = 0);
+ DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
+ DIFile File, unsigned LineNumber,
+ uint64_t SizeInBits, uint64_t AlignInBits,
+ unsigned Flags, DIType DerivedFrom,
+ DIArray Elements, unsigned RunTimeLang = 0,
+ MDNode *VTableHolder = 0);
/// createUnionType - Create debugging information entry for an union.
/// @param Scope Scope in which this union is defined.
Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=176004&r1=176003&r2=176004&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Sun Feb 24 19:07:18 2013
@@ -508,11 +508,15 @@ DIType DIBuilder::createClassType(DIDesc
}
/// createStructType - Create debugging information entry for a struct.
-DIType DIBuilder::createStructType(DIDescriptor Context, StringRef Name,
- DIFile File, unsigned LineNumber,
- uint64_t SizeInBits, uint64_t AlignInBits,
- unsigned Flags, DIArray Elements,
- unsigned RunTimeLang) {
+DICompositeType DIBuilder::createStructType(DIDescriptor Context,
+ StringRef Name, DIFile File,
+ unsigned LineNumber,
+ uint64_t SizeInBits,
+ uint64_t AlignInBits,
+ unsigned Flags, DIType DerivedFrom,
+ DIArray Elements,
+ unsigned RunTimeLang,
+ MDNode *VTableHolder) {
// TAG_structure_type is encoded in DICompositeType format.
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_structure_type),
@@ -524,13 +528,13 @@ DIType DIBuilder::createStructType(DIDes
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
- NULL,
+ DerivedFrom,
Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
- NULL,
+ VTableHolder,
NULL,
};
- return DIType(MDNode::get(VMContext, Elts));
+ return DICompositeType(MDNode::get(VMContext, Elts));
}
/// createUnionType - Create debugging information entry for an union.
More information about the llvm-commits
mailing list