[cfe-commits] r128323 - /cfe/trunk/lib/CodeGen/CGVTables.cpp
Ken Dyck
kd at kendyck.com
Fri Mar 25 18:36:26 PDT 2011
Author: kjdyck
Date: Fri Mar 25 20:36:26 2011
New Revision: 128323
URL: http://llvm.org/viewvc/llvm-project?rev=128323&view=rev
Log:
Convert the OffsetInLayoutClass parameter of
FinalOverriders::ComputeBaseOffsets() to CharUnits. 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=128323&r1=128322&r2=128323&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Fri Mar 25 20:36:26 2011
@@ -111,7 +111,7 @@
/// ComputeBaseOffsets - Compute the offsets for all base subobjects of the
/// given base.
void ComputeBaseOffsets(BaseSubobject Base, bool IsVirtual,
- uint64_t OffsetInLayoutClass,
+ CharUnits OffsetInLayoutClass,
SubobjectOffsetMapTy &SubobjectOffsets,
SubobjectOffsetMapTy &SubobjectLayoutClassOffsets,
SubobjectCountMapTy &SubobjectCounts);
@@ -163,8 +163,9 @@
SubobjectCountMapTy SubobjectCounts;
ComputeBaseOffsets(BaseSubobject(MostDerivedClass, CharUnits::Zero()),
/*IsVirtual=*/false,
- MostDerivedClassOffset, SubobjectOffsets,
- SubobjectLayoutClassOffsets, SubobjectCounts);
+ Context.toCharUnitsFromBits(MostDerivedClassOffset),
+ SubobjectOffsets, SubobjectLayoutClassOffsets,
+ SubobjectCounts);
// Get the the final overriders.
CXXFinalOverriderMap FinalOverriders;
@@ -323,7 +324,7 @@
void
FinalOverriders::ComputeBaseOffsets(BaseSubobject Base, bool IsVirtual,
- uint64_t OffsetInLayoutClass,
+ CharUnits OffsetInLayoutClass,
SubobjectOffsetMapTy &SubobjectOffsets,
SubobjectOffsetMapTy &SubobjectLayoutClassOffsets,
SubobjectCountMapTy &SubobjectCounts) {
@@ -341,7 +342,7 @@
SubobjectOffsets[std::make_pair(RD, SubobjectNumber)] = Base.getBaseOffset();
SubobjectLayoutClassOffsets[std::make_pair(RD, SubobjectNumber)] =
- Context.toCharUnitsFromBits(OffsetInLayoutClass);
+ OffsetInLayoutClass;
// Traverse our bases.
for (CXXRecordDecl::base_class_const_iterator I = RD->bases_begin(),
@@ -367,12 +368,11 @@
CharUnits Offset = Layout.getBaseClassOffset(BaseDecl);
BaseOffset = Base.getBaseOffset() + Offset;
- BaseOffsetInLayoutClass =
- Context.toCharUnitsFromBits(OffsetInLayoutClass) + Offset;
+ BaseOffsetInLayoutClass = OffsetInLayoutClass + Offset;
}
ComputeBaseOffsets(BaseSubobject(BaseDecl, BaseOffset),
- I->isVirtual(), Context.toBits(BaseOffsetInLayoutClass),
+ I->isVirtual(), BaseOffsetInLayoutClass,
SubobjectOffsets, SubobjectLayoutClassOffsets,
SubobjectCounts);
}
More information about the cfe-commits
mailing list