diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-24 03:57:14 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-24 03:57:14 +0000 |
commit | 5c6c1d9eca7ce932eff011cd3e592f606e60b4be (patch) | |
tree | 15066f8809d4c5211084bff7faa3930f69b3925c /lib/CodeGen/CGClass.cpp | |
parent | 05030bb6790b259a169b25665656db2aee30ccda (diff) |
More vtable work; preparations for moving over to the new vtable layout code (finally).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGClass.cpp')
-rw-r--r-- | lib/CodeGen/CGClass.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 4d5fdfe06e..af846329af 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -1560,9 +1560,10 @@ void CodeGenFunction::InitializeVtablePtrs(const CXXRecordDecl *ClassDecl) { if (!ClassDecl->isDynamicClass()) return; - llvm::Constant *VTable = CGM.getVTables().getVtable(ClassDecl); - CodeGenVTables::AddrSubMap_t& AddressPoints = - *(*CGM.getVTables().AddressPoints[ClassDecl])[ClassDecl]; + llvm::Constant *VTable = CGM.getVTables().getAddrOfVTable(ClassDecl); + const CodeGenVTables::AddrSubMap_t& AddressPoints = + CGM.getVTables().getAddressPoints(ClassDecl); + llvm::Value *ThisPtr = LoadCXXThis(); const ASTRecordLayout &Layout = getContext().getASTRecordLayout(ClassDecl); @@ -1584,7 +1585,7 @@ void CodeGenFunction::InitializeVtablePtrs(const CXXRecordDecl *ClassDecl) { void CodeGenFunction::InitializeVtablePtrsRecursive( const CXXRecordDecl *ClassDecl, llvm::Constant *Vtable, - CodeGenVTables::AddrSubMap_t& AddressPoints, + const CodeGenVTables::AddrSubMap_t& AddressPoints, llvm::Value *ThisPtr, uint64_t Offset) { if (!ClassDecl->isDynamicClass()) @@ -1607,7 +1608,8 @@ void CodeGenFunction::InitializeVtablePtrsRecursive( // Compute the address point assert(AddressPoints.count(std::make_pair(ClassDecl, Offset)) && "Missing address point for class"); - uint64_t AddressPoint = AddressPoints[std::make_pair(ClassDecl, Offset)]; + uint64_t AddressPoint = + AddressPoints.lookup(std::make_pair(ClassDecl, Offset)); llvm::Value *VtableAddressPoint = Builder.CreateConstInBoundsGEP2_64(Vtable, 0, AddressPoint); |