Replace copy loops with memcpy.

llvm-svn: 98055
This commit is contained in:
Benjamin Kramer 2010-03-09 12:53:38 +00:00
parent 5674c34780
commit bbf5c262ab
1 changed files with 2 additions and 4 deletions

View File

@ -32,8 +32,7 @@ ASTRecordLayout::ASTRecordLayout(ASTContext &Ctx, uint64_t size, unsigned alignm
FieldCount(fieldcount), CXXInfo(0) {
if (FieldCount > 0) {
FieldOffsets = new (Ctx) uint64_t[FieldCount];
for (unsigned i = 0; i < FieldCount; ++i)
FieldOffsets[i] = fieldoffsets[i];
memcpy(FieldOffsets, fieldoffsets, FieldCount * sizeof(*FieldOffsets));
}
}
@ -55,8 +54,7 @@ ASTRecordLayout::ASTRecordLayout(ASTContext &Ctx,
{
if (FieldCount > 0) {
FieldOffsets = new (Ctx) uint64_t[FieldCount];
for (unsigned i = 0; i < FieldCount; ++i)
FieldOffsets[i] = fieldoffsets[i];
memcpy(FieldOffsets, fieldoffsets, FieldCount * sizeof(*FieldOffsets));
}
CXXInfo->PrimaryBase = PrimaryBase;