aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-01-17 17:10:44 +0000
committerAnders Carlsson <andersca@mac.com>2010-01-17 17:10:44 +0000
commite74f3d07f075914dd250cadca24dd708916b4d55 (patch)
tree1987f16d79c9f8fb9cd3029860ac12f3da102ec4 /lib/CodeGen/CGVtable.cpp
parentafe859a9a6217f177daf42ebab294a90bfe8a6ab (diff)
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
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp14
1 files changed, 12 insertions, 2 deletions
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)