From: Anders Carlsson Date: Sun, 17 Jan 2010 17:10:44 +0000 (+0000) Subject: Get the ctor vtable address points directly from the VTT builder. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e74f3d07f075914dd250cadca24dd708916b4d55;p=clang Get the ctor vtable address points directly from the VTT builder. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93681 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index ae900d6ae7..27cb661292 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -1266,9 +1266,19 @@ class VTTBuilder { const CXXRecordDecl *VtableClass, const CXXRecordDecl *RD, uint64_t Offset) { - int64_t AddressPoint = - (*AddressPoints[VtableClass])[std::make_pair(RD, Offset)]; + uint64_t AddressPoint; + if (VtableClass != Class) { + // We have a ctor vtable, look for the address point in the ctor vtable + // address points. + AddressPoint = + CtorVtableAddressPoints[std::make_pair(VtableClass, + BaseSubobject(RD, Offset))]; + } else { + AddressPoint = + (*AddressPoints[VtableClass])[std::make_pair(RD, Offset)]; + } + // FIXME: We can never have 0 address point. Do this for now so gepping // retains the same structure. Later we'll just assert. if (AddressPoint == 0)