]> granicus.if.org Git - clang/commitdiff
Add a function for getting the vtable address point of a class.
authorAnders Carlsson <andersca@mac.com>
Sat, 5 Dec 2009 21:03:56 +0000 (21:03 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 5 Dec 2009 21:03:56 +0000 (21:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90674 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp
lib/CodeGen/CGVtable.h

index b01f4cf97b7c893a442e43dffd813c3f9b729ebc..2fca7a75f9a9a00c6bb35544dac75a2406decc4c 100644 (file)
@@ -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) {
index 5c2b74c9dd865932b10196eeac68e5752176dcb3..86633d4471c1f8c6cd1fd6797dd300696e616e8b 100644 (file)
@@ -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);