From: Rui Ueyama Date: Thu, 15 Jan 2015 23:15:09 +0000 (+0000) Subject: Simplify. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2836079df8fd3aacf6486be18c097ac45317ebf;p=platform%2Fupstream%2Fllvm.git Simplify. llvm-svn: 226225 --- diff --git a/lld/lib/Driver/CoreDriver.cpp b/lld/lib/Driver/CoreDriver.cpp index e043803..8bbc501 100644 --- a/lld/lib/Driver/CoreDriver.cpp +++ b/lld/lib/Driver/CoreDriver.cpp @@ -150,10 +150,8 @@ bool CoreDriver::parse(int argc, const char *argv[], CoreLinkingContext &ctx, case OPT_INPUT: { std::vector> files = loadFile(ctx, inputArg->getValue(), false); - for (std::unique_ptr &file : files) { - ctx.getNodes().push_back(std::unique_ptr( - new FileNode(std::move(file)))); - } + for (std::unique_ptr &file : files) + ctx.getNodes().push_back(llvm::make_unique(std::move(file))); break; } diff --git a/lld/lib/Driver/GnuLdDriver.cpp b/lld/lib/Driver/GnuLdDriver.cpp index 5acc256..ac25673 100644 --- a/lld/lib/Driver/GnuLdDriver.cpp +++ b/lld/lib/Driver/GnuLdDriver.cpp @@ -273,8 +273,7 @@ evaluateLinkerScript(ELFLinkingContext &ctx, StringRef path, for (std::unique_ptr &file : files) { if (ctx.logInputFiles()) diag << file->path() << "\n"; - ctx.getNodes().push_back( - std::unique_ptr(new FileNode(std::move(file)))); + ctx.getNodes().push_back(llvm::make_unique(std::move(file))); ++numfiles; } } @@ -590,8 +589,7 @@ bool GnuLdDriver::parse(int argc, const char *argv[], ErrorOr pathOrErr = findFile(*ctx, path, dashL); if (std::error_code ec = pathOrErr.getError()) { auto file = llvm::make_unique(path, ec); - ctx->getNodes().push_back( - std::unique_ptr(new FileNode(std::move(file)))); + ctx->getNodes().push_back(llvm::make_unique(std::move(file))); break; } std::string realpath = pathOrErr.get(); @@ -614,8 +612,7 @@ bool GnuLdDriver::parse(int argc, const char *argv[], for (std::unique_ptr &file : files) { if (ctx->logInputFiles()) diagnostics << file->path() << "\n"; - ctx->getNodes().push_back( - std::unique_ptr(new FileNode(std::move(file)))); + ctx->getNodes().push_back(llvm::make_unique(std::move(file))); } numfiles += files.size(); break; diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index 8977cb7..d968f26 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -1414,8 +1414,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], if (file->parse()) return false; ctx.getResolvableSymsFile()->add(file.get()); - ctx.getNodes().push_back( - std::unique_ptr(new FileNode(std::move(file)))); + ctx.getNodes().push_back(llvm::make_unique(std::move(file))); } // Add the library group to the input graph. @@ -1431,8 +1430,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], if (file->parse()) return false; ctx.getResolvableSymsFile()->add(file.get()); - ctx.addLibraryFile( - std::unique_ptr(new FileNode(std::move(file)))); + ctx.addLibraryFile(llvm::make_unique(std::move(file))); } }