]> granicus.if.org Git - clang/commitdiff
[CodeGen] Fold memcpy into SmallVector initializer. No functionality change.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 4 Aug 2015 15:38:49 +0000 (15:38 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 4 Aug 2015 15:38:49 +0000 (15:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243992 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGException.cpp

index 16dc7d16dd4220c5a6561032451b7f04e3f0bd23..7f4d1c01a75196fc7abe62ff729d7c3b6f0007b6 100644 (file)
@@ -1008,9 +1008,8 @@ void CodeGenFunction::ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock) {
 
   // Copy the handler blocks off before we pop the EH stack.  Emitting
   // the handlers might scribble on this memory.
-  SmallVector<EHCatchScope::Handler, 8> Handlers(NumHandlers);
-  memcpy(Handlers.data(), CatchScope.begin(),
-         NumHandlers * sizeof(EHCatchScope::Handler));
+  SmallVector<EHCatchScope::Handler, 8> Handlers(
+      CatchScope.begin(), CatchScope.begin() + NumHandlers);
 
   EHStack.popCatch();