[cfe-commits] r128773 - in /cfe/trunk/lib/CodeGen: CGVTables.cpp CGVTables.h

Ken Dyck kd at kendyck.com
Sat Apr 2 10:13:02 PDT 2011


Author: kjdyck
Date: Sat Apr  2 12:13:02 2011
New Revision: 128773

URL: http://llvm.org/viewvc/llvm-project?rev=128773&view=rev
Log:
Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
change in functionality intended.

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

Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=128773&r1=128772&r2=128773&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Sat Apr  2 12:13:02 2011
@@ -2438,7 +2438,7 @@
   VirtualBaseClassOffsetOffsetsMapTy::iterator I = 
     VirtualBaseClassOffsetOffsets.find(ClassPair);
   if (I != VirtualBaseClassOffsetOffsets.end())
-    return I->second;
+    return I->second.getQuantity();
   
   VCallAndVBaseOffsetBuilder Builder(RD, RD, /*FinalOverriders=*/0,
                                      BaseSubobject(RD, CharUnits::Zero()),
@@ -2452,13 +2452,13 @@
     ClassPairTy ClassPair(RD, I->first);
     
     VirtualBaseClassOffsetOffsets.insert(
-        std::make_pair(ClassPair, I->second.getQuantity()));
+        std::make_pair(ClassPair, I->second));
   }
   
   I = VirtualBaseClassOffsetOffsets.find(ClassPair);
   assert(I != VirtualBaseClassOffsetOffsets.end() && "Did not find index!");
   
-  return I->second;
+  return I->second.getQuantity();
 }
 
 uint64_t
@@ -2910,7 +2910,7 @@
     ClassPairTy ClassPair(RD, I->first);
     
     VirtualBaseClassOffsetOffsets.insert(
-        std::make_pair(ClassPair, I->second.getQuantity()));
+        std::make_pair(ClassPair, I->second));
   }
 }
 

Modified: cfe/trunk/lib/CodeGen/CGVTables.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.h?rev=128773&r1=128772&r2=128773&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.h (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.h Sat Apr  2 12:13:02 2011
@@ -103,9 +103,9 @@
                     const CXXRecordDecl *> ClassPairTy;
 
   /// VirtualBaseClassOffsetOffsets - Contains the vtable offset (relative to 
-  /// the address point) in bytes where the offsets for virtual bases of a class
+  /// the address point) in chars where the offsets for virtual bases of a class
   /// are stored.
-  typedef llvm::DenseMap<ClassPairTy, int64_t> 
+  typedef llvm::DenseMap<ClassPairTy, CharUnits> 
     VirtualBaseClassOffsetOffsetsMapTy;
   VirtualBaseClassOffsetOffsetsMapTy VirtualBaseClassOffsetOffsets;
 





More information about the cfe-commits mailing list