[cfe-commits] r128385 - /cfe/trunk/lib/CodeGen/CGVTables.cpp
Ken Dyck
kd at kendyck.com
Sun Mar 27 12:15:12 PDT 2011
Author: kjdyck
Date: Sun Mar 27 14:15:11 2011
New Revision: 128385
URL: http://llvm.org/viewvc/llvm-project?rev=128385&view=rev
Log:
Convert the offset parameters of AddMethods() 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=128385&r1=128384&r2=128385&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Sun Mar 27 14:15:11 2011
@@ -1107,9 +1107,9 @@
/// AddMethods - Add the methods of this base subobject and all its
/// primary bases to the vtable components vector.
- void AddMethods(BaseSubobject Base, uint64_t BaseOffsetInLayoutClass,
+ void AddMethods(BaseSubobject Base, CharUnits BaseOffsetInLayoutClass,
const CXXRecordDecl *FirstBaseInPrimaryBaseChain,
- uint64_t FirstBaseOffsetInLayoutClass,
+ CharUnits FirstBaseOffsetInLayoutClass,
PrimaryBasesSetVectorTy &PrimaryBases);
// LayoutVTable - Layout the vtable for the given base class, including its
@@ -1584,16 +1584,16 @@
}
void
-VTableBuilder::AddMethods(BaseSubobject Base, uint64_t BaseOffsetInLayoutClass,
+VTableBuilder::AddMethods(BaseSubobject Base, CharUnits BaseOffsetInLayoutClass,
const CXXRecordDecl *FirstBaseInPrimaryBaseChain,
- uint64_t FirstBaseOffsetInLayoutClass,
+ CharUnits FirstBaseOffsetInLayoutClass,
PrimaryBasesSetVectorTy &PrimaryBases) {
const CXXRecordDecl *RD = Base.getBase();
const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
if (const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase()) {
CharUnits PrimaryBaseOffset;
- uint64_t PrimaryBaseOffsetInLayoutClass;
+ CharUnits PrimaryBaseOffsetInLayoutClass;
if (Layout.isPrimaryBaseVirtual()) {
assert(Layout.getVBaseClassOffsetInBits(PrimaryBase) == 0 &&
"Primary vbase should have a zero offset!");
@@ -1608,7 +1608,7 @@
Context.getASTRecordLayout(LayoutClass);
PrimaryBaseOffsetInLayoutClass =
- LayoutClassLayout.getVBaseClassOffsetInBits(PrimaryBase);
+ LayoutClassLayout.getVBaseClassOffset(PrimaryBase);
} else {
assert(Layout.getBaseClassOffsetInBits(PrimaryBase) == 0 &&
"Primary base should have a zero offset!");
@@ -1650,9 +1650,8 @@
"Did not find the overridden method!");
MethodInfo &OverriddenMethodInfo = MethodInfoMap[OverriddenMD];
- MethodInfo MethodInfo(Base.getBaseOffset(),
- Context.toCharUnitsFromBits(BaseOffsetInLayoutClass),
- OverriddenMethodInfo.VTableIndex);
+ MethodInfo MethodInfo(Base.getBaseOffset(), BaseOffsetInLayoutClass,
+ OverriddenMethodInfo.VTableIndex);
assert(!MethodInfoMap.count(MD) &&
"Should not have method info for this method yet!");
@@ -1667,9 +1666,8 @@
if (!isBuildingConstructorVTable() && OverriddenMD != MD) {
// Compute the this adjustment.
ThisAdjustment ThisAdjustment =
- ComputeThisAdjustment(OverriddenMD,
- Context.toCharUnitsFromBits(BaseOffsetInLayoutClass),
- Overrider);
+ ComputeThisAdjustment(OverriddenMD, BaseOffsetInLayoutClass,
+ Overrider);
if (ThisAdjustment.VCallOffsetOffset &&
Overrider.Method->getParent() == MostDerivedClass) {
@@ -1693,8 +1691,7 @@
}
// Insert the method info for this method.
- MethodInfo MethodInfo(Base.getBaseOffset(),
- Context.toCharUnitsFromBits(BaseOffsetInLayoutClass),
+ MethodInfo MethodInfo(Base.getBaseOffset(), BaseOffsetInLayoutClass,
Components.size());
assert(!MethodInfoMap.count(MD) &&
@@ -1703,9 +1700,9 @@
// Check if this overrider is going to be used.
const CXXMethodDecl *OverriderMD = Overrider.Method;
- if (!IsOverriderUsed(OverriderMD, BaseOffsetInLayoutClass,
+ if (!IsOverriderUsed(OverriderMD, Context.toBits(BaseOffsetInLayoutClass),
FirstBaseInPrimaryBaseChain,
- FirstBaseOffsetInLayoutClass)) {
+ Context.toBits(FirstBaseOffsetInLayoutClass))) {
Components.push_back(VTableComponent::MakeUnusedFunction(OverriderMD));
continue;
}
@@ -1781,7 +1778,8 @@
// Now go through all virtual member functions and add them.
PrimaryBasesSetVectorTy PrimaryBases;
- AddMethods(Base, OffsetInLayoutClass, Base.getBase(), OffsetInLayoutClass,
+ AddMethods(Base, Context.toCharUnitsFromBits(OffsetInLayoutClass),
+ Base.getBase(), Context.toCharUnitsFromBits(OffsetInLayoutClass),
PrimaryBases);
// Compute 'this' pointer adjustments.
More information about the cfe-commits
mailing list