[cfe-commits] r128317 - /cfe/trunk/lib/CodeGen/CGVTables.cpp
Ken Dyck
kd at kendyck.com
Fri Mar 25 18:09:13 PDT 2011
Author: kjdyck
Date: Fri Mar 25 20:09:13 2011
New Revision: 128317
URL: http://llvm.org/viewvc/llvm-project?rev=128317&view=rev
Log:
Convert the offsets in SubobjectOffsetMapTy 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=128317&r1=128316&r2=128317&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Fri Mar 25 20:09:13 2011
@@ -104,7 +104,7 @@
/// as a record decl and a subobject number) and its offsets in the most
/// derived class as well as the layout class.
typedef llvm::DenseMap<std::pair<const CXXRecordDecl *, unsigned>,
- uint64_t> SubobjectOffsetMapTy;
+ CharUnits> SubobjectOffsetMapTy;
typedef llvm::DenseMap<const CXXRecordDecl *, unsigned> SubobjectCountMapTy;
@@ -182,7 +182,7 @@
SubobjectNumber)) &&
"Did not find subobject offset!");
- uint64_t BaseOffset = SubobjectOffsets[std::make_pair(MD->getParent(),
+ CharUnits BaseOffset = SubobjectOffsets[std::make_pair(MD->getParent(),
SubobjectNumber)];
assert(I->second.size() == 1 && "Final overrider is not unique!");
@@ -192,14 +192,15 @@
assert(SubobjectLayoutClassOffsets.count(
std::make_pair(OverriderRD, Method.Subobject))
&& "Did not find subobject offset!");
- uint64_t OverriderOffset =
+ CharUnits OverriderOffset =
SubobjectLayoutClassOffsets[std::make_pair(OverriderRD,
Method.Subobject)];
- OverriderInfo& Overrider = OverridersMap[std::make_pair(MD, BaseOffset)];
+ OverriderInfo& Overrider =
+ OverridersMap[std::make_pair(MD, Context.toBits(BaseOffset))];
assert(!Overrider.Method && "Overrider should not exist yet!");
- Overrider.Offset = OverriderOffset;
+ Overrider.Offset = Context.toBits(OverriderOffset);
Overrider.Method = Method.Method;
}
}
@@ -339,10 +340,9 @@
assert(!SubobjectLayoutClassOffsets.count(std::make_pair(RD, SubobjectNumber))
&& "Subobject offset already exists!");
- SubobjectOffsets[std::make_pair(RD, SubobjectNumber)] =
- Context.toBits(Base.getBaseOffset());
+ SubobjectOffsets[std::make_pair(RD, SubobjectNumber)] = Base.getBaseOffset();
SubobjectLayoutClassOffsets[std::make_pair(RD, SubobjectNumber)] =
- OffsetInLayoutClass;
+ Context.toCharUnitsFromBits(OffsetInLayoutClass);
// Traverse our bases.
for (CXXRecordDecl::base_class_const_iterator I = RD->bases_begin(),
More information about the cfe-commits
mailing list