[cfe-commits] r129043 - /cfe/trunk/lib/CodeGen/CGVTables.cpp

Ken Dyck kd at kendyck.com
Wed Apr 6 17:55:01 PDT 2011


Author: kjdyck
Date: Wed Apr  6 19:55:01 2011
New Revision: 129043

URL: http://llvm.org/viewvc/llvm-project?rev=129043&view=rev
Log:
Reapply r128770. It's not the cause of the issues Devang saw with debug info. 

Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. No
change in functionality intended.


Modified:
    cfe/trunk/lib/CodeGen/CGVTables.cpp

Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=129043&r1=129042&r2=129043&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Wed Apr  6 19:55:01 2011
@@ -706,7 +706,7 @@
 /// VCallAndVBaseOffsetBuilder - Class for building vcall and vbase offsets.
 class VCallAndVBaseOffsetBuilder {
 public:
-  typedef llvm::DenseMap<const CXXRecordDecl *, int64_t> 
+  typedef llvm::DenseMap<const CXXRecordDecl *, CharUnits> 
     VBaseOffsetOffsetsMapTy;
 
 private:
@@ -937,7 +937,7 @@
 
       CharUnits VBaseOffsetOffset = getCurrentOffsetOffset();
       VBaseOffsetOffsets.insert(
-          std::make_pair(BaseDecl, VBaseOffsetOffset.getQuantity()));
+          std::make_pair(BaseDecl, VBaseOffsetOffset));
 
       Components.push_back(
           VTableComponent::MakeVBaseOffset(Offset));
@@ -956,7 +956,7 @@
   typedef llvm::SmallSetVector<const CXXRecordDecl *, 8> 
     PrimaryBasesSetVectorTy;
   
-  typedef llvm::DenseMap<const CXXRecordDecl *, int64_t> 
+  typedef llvm::DenseMap<const CXXRecordDecl *, CharUnits> 
     VBaseOffsetOffsetsMapTy;
   
   typedef llvm::DenseMap<BaseSubobject, uint64_t> 
@@ -1335,7 +1335,7 @@
       if (Offset.DerivedClass == MostDerivedClass) {
         // We can get the offset offset directly from our map.
         Adjustment.VBaseOffsetOffset = 
-          VBaseOffsetOffsets.lookup(Offset.VirtualBase);
+          VBaseOffsetOffsets.lookup(Offset.VirtualBase).getQuantity();
       } else {
         Adjustment.VBaseOffsetOffset = 
           VTables.getVirtualBaseOffsetOffset(Offset.DerivedClass,
@@ -2177,8 +2177,9 @@
     for (VBaseOffsetOffsetsMapTy::const_iterator I = VBaseOffsetOffsets.begin(),
          E = VBaseOffsetOffsets.end(); I != E; ++I) {
       std::string ClassName = I->first->getQualifiedNameAsString();
-      int64_t OffsetOffset = I->second;
-      ClassNamesAndOffsets.insert(std::make_pair(ClassName, OffsetOffset));
+      CharUnits OffsetOffset = I->second;
+      ClassNamesAndOffsets.insert(
+          std::make_pair(ClassName, OffsetOffset.getQuantity()));
     }
     
     Out << "Virtual base offset offsets for '";
@@ -2450,7 +2451,8 @@
     // Insert all types.
     ClassPairTy ClassPair(RD, I->first);
     
-    VirtualBaseClassOffsetOffsets.insert(std::make_pair(ClassPair, I->second));
+    VirtualBaseClassOffsetOffsets.insert(
+        std::make_pair(ClassPair, I->second.getQuantity()));
   }
   
   I = VirtualBaseClassOffsetOffsets.find(ClassPair);
@@ -2907,7 +2909,8 @@
     // Insert all types.
     ClassPairTy ClassPair(RD, I->first);
     
-    VirtualBaseClassOffsetOffsets.insert(std::make_pair(ClassPair, I->second));
+    VirtualBaseClassOffsetOffsets.insert(
+        std::make_pair(ClassPair, I->second.getQuantity()));
   }
 }
 





More information about the cfe-commits mailing list