aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-05 21:03:56 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-05 21:03:56 +0000
commit9ac95b99acf6b4e1f54fe70e02cbb0d3c72f9f2d (patch)
tree40d4516ec075b35e7d6c52949e9160ae8bc42d81
parent4282edfe696a0c15bb8656f3e13dd6643fd3057d (diff)
Add a function for getting the vtable address point of a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90674 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGVtable.cpp7
-rw-r--r--lib/CodeGen/CGVtable.h5
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index b01f4cf97b..2fca7a75f9 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -1075,6 +1075,13 @@ int64_t CGVtableInfo::getVirtualBaseOffsetIndex(const CXXRecordDecl *RD,
return I->second;
}
+uint64_t CGVtableInfo::getVtableAddressPoint(const CXXRecordDecl *RD) {
+ uint64_t AddressPoint =
+ (*(*(CGM.AddressPoints[RD]))[RD])[std::make_pair(RD, 0)];
+
+ return AddressPoint;
+}
+
llvm::Constant *CodeGenModule::GenerateVtable(const CXXRecordDecl *LayoutClass,
const CXXRecordDecl *RD,
uint64_t Offset) {
diff --git a/lib/CodeGen/CGVtable.h b/lib/CodeGen/CGVtable.h
index 5c2b74c9dd..86633d4471 100644
--- a/lib/CodeGen/CGVtable.h
+++ b/lib/CodeGen/CGVtable.h
@@ -113,6 +113,11 @@ public:
int64_t getVirtualBaseOffsetIndex(const CXXRecordDecl *RD,
const CXXRecordDecl *VBase);
+ /// getVtableAddressPoint - returns the address point of the vtable for the
+ /// given record decl.
+ /// FIXME: This should return a list of address points.
+ uint64_t getVtableAddressPoint(const CXXRecordDecl *RD);
+
llvm::Constant *getVtable(const CXXRecordDecl *RD);
llvm::Constant *getCtorVtable(const CXXRecordDecl *RD,
const CXXRecordDecl *Class, uint64_t Offset);