[Reapply r128773. This is not the source of the issues Devang was seeing

with debug info.]

Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
change in functionality intended.

llvm-svn: 129048
This commit is contained in:
Ken Dyck 2011-04-07 01:22:42 +00:00
parent c0e86fb965
commit 3a09bc5ab0
2 changed files with 6 additions and 6 deletions

View File

@ -2438,7 +2438,7 @@ int64_t CodeGenVTables::getVirtualBaseOffsetOffset(const CXXRecordDecl *RD,
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 @@ int64_t CodeGenVTables::getVirtualBaseOffsetOffset(const CXXRecordDecl *RD,
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 @@ void CodeGenVTables::ComputeVTableRelatedInformation(const CXXRecordDecl *RD,
ClassPairTy ClassPair(RD, I->first);
VirtualBaseClassOffsetOffsets.insert(
std::make_pair(ClassPair, I->second.getQuantity()));
std::make_pair(ClassPair, I->second));
}
}

View File

@ -103,9 +103,9 @@ class CodeGenVTables {
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;