[cfe-commits] r128770 - /cfe/trunk/lib/CodeGen/CGVTables.cpp
Ken Dyck
kd at kendyck.com
Sat Apr 2 09:57:20 PDT 2011
Author: kjdyck
Date: Sat Apr 2 11:57:20 2011
New Revision: 128770
URL: http://llvm.org/viewvc/llvm-project?rev=128770&view=rev
Log:
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=128770&r1=128769&r2=128770&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Sat Apr 2 11:57:20 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