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 | b35ea55e2e3b5ac7e0e450ee32f9823c2c5b6c25 (patch) | |
tree | b10c64d62432a2893dee915e24e4f88fe90162a2 /clang/lib/CodeGen/CGClass.cpp | |
parent | 7c969558d9fcf893f6c1abc77b29dfc3285770ce (diff) | |
download | bcm5719-llvm-b35ea55e2e3b5ac7e0e450ee32f9823c2c5b6c25.tar.gz bcm5719-llvm-b35ea55e2e3b5ac7e0e450ee32f9823c2c5b6c25.zip |
More vtable work; preparations for moving over to the new vtable layout code (finally).
llvm-svn: 99381
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 4d5fdfe06e0..af846329aff 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/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); |