Skip to content

Commit

Permalink
[WebAssembly] Use make<> rather then make_unique<>. NFC.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbc100 committed Feb 21, 2018
1 parent 9f93422 commit 011dce2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lld/wasm/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class Writer {
std::vector<OutputSection *> OutputSections;

std::unique_ptr<FileOutputBuffer> Buffer;
std::unique_ptr<SyntheticFunction> CtorFunction;
std::string CtorFunctionBody;

std::vector<OutputSegment *> Segments;
Expand Down Expand Up @@ -852,10 +851,10 @@ void Writer::createCtorFunction() {
ArrayRef<uint8_t> BodyArray(
reinterpret_cast<const uint8_t *>(CtorFunctionBody.data()),
CtorFunctionBody.size());
CtorFunction = llvm::make_unique<SyntheticFunction>(
Signature, BodyArray, WasmSym::CallCtors->getName());
CtorFunction->setOutputIndex(FunctionIndex);
InputFunctions.emplace_back(CtorFunction.get());
SyntheticFunction *F = make<SyntheticFunction>(Signature, BodyArray,
WasmSym::CallCtors->getName());
F->setOutputIndex(FunctionIndex);
InputFunctions.emplace_back(F);
}

// Populate InitFunctions vector with init functions from all input objects.
Expand Down

0 comments on commit 011dce2

Please sign in to comment.