More vtable work; preparations for moving over to the new vtable layout code (finally).

llvm-svn: 99381
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 4d5fdfe..af84632 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -1560,9 +1560,10 @@
   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::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 @@
   // 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);