[cfe-commits] r90674 - in /cfe/trunk/lib/CodeGen: CGVtable.cpp CGVtable.h
Anders Carlsson
andersca at mac.com
Sat Dec 5 13:03:56 PST 2009
Author: andersca
Date: Sat Dec 5 15:03:56 2009
New Revision: 90674
URL: http://llvm.org/viewvc/llvm-project?rev=90674&view=rev
Log:
Add a function for getting the vtable address point of a class.
Modified:
cfe/trunk/lib/CodeGen/CGVtable.cpp
cfe/trunk/lib/CodeGen/CGVtable.h
Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=90674&r1=90673&r2=90674&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sat Dec 5 15:03:56 2009
@@ -1075,6 +1075,13 @@
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) {
Modified: cfe/trunk/lib/CodeGen/CGVtable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.h?rev=90674&r1=90673&r2=90674&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.h (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.h Sat Dec 5 15:03:56 2009
@@ -113,6 +113,11 @@
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);
More information about the cfe-commits
mailing list