[cfe-commits] r98055 - /cfe/trunk/lib/AST/RecordLayout.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Mar 9 04:53:39 PST 2010
Author: d0k
Date: Tue Mar 9 06:53:38 2010
New Revision: 98055
URL: http://llvm.org/viewvc/llvm-project?rev=98055&view=rev
Log:
Replace copy loops with memcpy.
Modified:
cfe/trunk/lib/AST/RecordLayout.cpp
Modified: cfe/trunk/lib/AST/RecordLayout.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayout.cpp?rev=98055&r1=98054&r2=98055&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayout.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayout.cpp Tue Mar 9 06:53:38 2010
@@ -32,8 +32,7 @@
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 @@
{
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;
More information about the cfe-commits
mailing list