mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 17:28:30 +08:00
Simplify.
llvm-svn: 226225
This commit is contained in:
@@ -150,10 +150,8 @@ bool CoreDriver::parse(int argc, const char *argv[], CoreLinkingContext &ctx,
|
||||
case OPT_INPUT: {
|
||||
std::vector<std::unique_ptr<File>> files
|
||||
= loadFile(ctx, inputArg->getValue(), false);
|
||||
for (std::unique_ptr<File> &file : files) {
|
||||
ctx.getNodes().push_back(std::unique_ptr<Node>(
|
||||
new FileNode(std::move(file))));
|
||||
}
|
||||
for (std::unique_ptr<File> &file : files)
|
||||
ctx.getNodes().push_back(llvm::make_unique<FileNode>(std::move(file)));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -273,8 +273,7 @@ evaluateLinkerScript(ELFLinkingContext &ctx, StringRef path,
|
||||
for (std::unique_ptr<File> &file : files) {
|
||||
if (ctx.logInputFiles())
|
||||
diag << file->path() << "\n";
|
||||
ctx.getNodes().push_back(
|
||||
std::unique_ptr<Node>(new FileNode(std::move(file))));
|
||||
ctx.getNodes().push_back(llvm::make_unique<FileNode>(std::move(file)));
|
||||
++numfiles;
|
||||
}
|
||||
}
|
||||
@@ -590,8 +589,7 @@ bool GnuLdDriver::parse(int argc, const char *argv[],
|
||||
ErrorOr<StringRef> pathOrErr = findFile(*ctx, path, dashL);
|
||||
if (std::error_code ec = pathOrErr.getError()) {
|
||||
auto file = llvm::make_unique<ErrorFile>(path, ec);
|
||||
ctx->getNodes().push_back(
|
||||
std::unique_ptr<FileNode>(new FileNode(std::move(file))));
|
||||
ctx->getNodes().push_back(llvm::make_unique<FileNode>(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> &file : files) {
|
||||
if (ctx->logInputFiles())
|
||||
diagnostics << file->path() << "\n";
|
||||
ctx->getNodes().push_back(
|
||||
std::unique_ptr<Node>(new FileNode(std::move(file))));
|
||||
ctx->getNodes().push_back(llvm::make_unique<FileNode>(std::move(file)));
|
||||
}
|
||||
numfiles += files.size();
|
||||
break;
|
||||
|
||||
@@ -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<Node>(new FileNode(std::move(file))));
|
||||
ctx.getNodes().push_back(llvm::make_unique<FileNode>(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<FileNode>(new FileNode(std::move(file))));
|
||||
ctx.addLibraryFile(llvm::make_unique<FileNode>(std::move(file)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user