diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-03-09 12:53:38 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-03-09 12:53:38 +0000 |
commit | bbf5c262ab6b4530baa91a7876e49b96dd482ccf (patch) | |
tree | a46accbb34a0ea371499dbae66b4e8ea24d7353a /clang/lib/AST/RecordLayout.cpp | |
parent | 5674c3478011ead8e4920f3bb69a2f3a6df63a5a (diff) | |
download | bcm5719-llvm-bbf5c262ab6b4530baa91a7876e49b96dd482ccf.tar.gz bcm5719-llvm-bbf5c262ab6b4530baa91a7876e49b96dd482ccf.zip |
Replace copy loops with memcpy.
llvm-svn: 98055
Diffstat (limited to 'clang/lib/AST/RecordLayout.cpp')
-rw-r--r-- | clang/lib/AST/RecordLayout.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/AST/RecordLayout.cpp b/clang/lib/AST/RecordLayout.cpp index 9f8bdec94ee..838753a1433 100644 --- a/clang/lib/AST/RecordLayout.cpp +++ b/clang/lib/AST/RecordLayout.cpp @@ -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; |