diff --git a/include/llvm/IR/DIBuilder.h b/include/llvm/IR/DIBuilder.h index 5482de87d6c..ae1ac650a9e 100644 --- a/include/llvm/IR/DIBuilder.h +++ b/include/llvm/IR/DIBuilder.h @@ -172,8 +172,12 @@ namespace llvm { /// \brief Create debugging information entry for a pointer to member. /// @param PointeeTy Type pointed to by this pointer. + /// @param SizeInBits Size. + /// @param AlignInBits Alignment. (optional) /// @param Class Type for which this pointer points to members of. - DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class); + DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class, + uint64_t SizeInBits, + uint64_t AlignInBits = 0); /// createReferenceType - Create debugging information entry for a c++ /// style reference or rvalue reference type. diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 1874d31e0a5..6485ca5a003 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -328,14 +328,15 @@ DIBuilder::createPointerType(DIType PointeeTy, uint64_t SizeInBits, return DIDerivedType(MDNode::get(VMContext, Elts)); } -DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy, - DIType Base) { +DIDerivedType +DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base, + uint64_t SizeInBits, uint64_t AlignInBits) { // Pointer types are encoded in DIDerivedType format. Metadata *Elts[] = {HeaderBuilder::get(dwarf::DW_TAG_ptr_to_member_type) .concat(StringRef()) .concat(0) // Line - .concat(0) // Size - .concat(0) // Align + .concat(SizeInBits) // Size + .concat(AlignInBits) // Align .concat(0) // Offset .concat(0) // Flags .get(VMContext),