diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 0af3d1521eb..ef279417b7e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -2099,8 +2099,7 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) { for (const DIDerivedType *I : Info.Inheritance) { if (I->getFlags() & DINode::FlagVirtual) { // Virtual base. - // FIXME: Emit VBPtrOffset when the frontend provides it. - unsigned VBPtrOffset = 0; + unsigned VBPtrOffset = I->getVBPtrOffset(); // FIXME: Despite the accessor name, the offset is really in bytes. unsigned VBTableIndex = I->getOffsetInBits() / 4; auto RecordKind = (I->getFlags() & DINode::FlagIndirectVirtualBase) == DINode::FlagIndirectVirtualBase diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 8596ebd9527..90a089bb969 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -318,10 +318,14 @@ DIDerivedType *DIBuilder::createFriend(DIType *Ty, DIType *FriendTy) { DIDerivedType *DIBuilder::createInheritance(DIType *Ty, DIType *BaseTy, uint64_t BaseOffset, + uint32_t VBPtrOffset, DINode::DIFlags Flags) { assert(Ty && "Unable to create inheritance"); + Metadata *ExtraData = ConstantAsMetadata::get( + ConstantInt::get(IntegerType::get(VMContext, 32), VBPtrOffset)); return DIDerivedType::get(VMContext, dwarf::DW_TAG_inheritance, "", nullptr, - 0, Ty, BaseTy, 0, 0, BaseOffset, None, Flags); + 0, Ty, BaseTy, 0, 0, BaseOffset, None, + Flags, ExtraData); } DIDerivedType *DIBuilder::createMemberType(DIScope *Scope, StringRef Name, |