From 011dce2d1430dce3b19475d9218889eaa4388818 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 21 Feb 2018 18:37:44 +0000 Subject: [PATCH] [WebAssembly] Use make<> rather then make_unique<>. NFC. lld uses an arena allocator to one of allocations like these can just use make<>. Differential Revision: https://reviews.llvm.org/D43587 llvm-svn: 325706 --- lld/wasm/Writer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index c553d0aafdf5..8a8381f75ab1 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -131,7 +131,6 @@ private: std::vector OutputSections; std::unique_ptr Buffer; - std::unique_ptr CtorFunction; std::string CtorFunctionBody; std::vector Segments; @@ -852,10 +851,10 @@ void Writer::createCtorFunction() { ArrayRef BodyArray( reinterpret_cast(CtorFunctionBody.data()), CtorFunctionBody.size()); - CtorFunction = llvm::make_unique( - Signature, BodyArray, WasmSym::CallCtors->getName()); - CtorFunction->setOutputIndex(FunctionIndex); - InputFunctions.emplace_back(CtorFunction.get()); + SyntheticFunction *F = make(Signature, BodyArray, + WasmSym::CallCtors->getName()); + F->setOutputIndex(FunctionIndex); + InputFunctions.emplace_back(F); } // Populate InitFunctions vector with init functions from all input objects.