From: Benjamin Kramer Date: Tue, 4 Aug 2015 15:38:49 +0000 (+0000) Subject: [CodeGen] Fold memcpy into SmallVector initializer. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e770ba628e812d34afb8963672b174533bd7c158;p=clang [CodeGen] Fold memcpy into SmallVector initializer. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243992 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 16dc7d16dd..7f4d1c01a7 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -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 Handlers(NumHandlers); - memcpy(Handlers.data(), CatchScope.begin(), - NumHandlers * sizeof(EHCatchScope::Handler)); + SmallVector Handlers( + CatchScope.begin(), CatchScope.begin() + NumHandlers); EHStack.popCatch();