summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/WinLinkDriver.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-01-15 08:46:36 +0000
committerRui Ueyama <ruiu@google.com>2015-01-15 08:46:36 +0000
commit883afba228f67bf156f299a137f74eb00f71010f (patch)
treea3605d91c4169ec91abe529507d079a6b77d03fc /lld/lib/Driver/WinLinkDriver.cpp
parentf8637360e2ea0e1c697bcfc24dafa8f12d31171c (diff)
downloadbcm5719-llvm-883afba228f67bf156f299a137f74eb00f71010f.tar.gz
bcm5719-llvm-883afba228f67bf156f299a137f74eb00f71010f.zip
Remove InputGraph and use std::vector<Node> instead.
In total we have removed more than 1000 lines! llvm-svn: 226149
Diffstat (limited to 'lld/lib/Driver/WinLinkDriver.cpp')
-rw-r--r--lld/lib/Driver/WinLinkDriver.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp
index 9aa447ac1ec..8977cb7034a 100644
--- a/lld/lib/Driver/WinLinkDriver.cpp
+++ b/lld/lib/Driver/WinLinkDriver.cpp
@@ -799,9 +799,9 @@ parseArgs(int argc, const char **argv, PECOFFLinkingContext &ctx,
// Returns true if the given file node has already been added to the input
// graph.
-static bool hasLibrary(const PECOFFLinkingContext &ctx, File *file) {
+static bool hasLibrary(PECOFFLinkingContext &ctx, File *file) {
StringRef path = file->path();
- for (std::unique_ptr<Node> &p : ctx.getInputGraph().members())
+ for (std::unique_ptr<Node> &p : ctx.getNodes())
if (auto *f = dyn_cast<FileNode>(p.get()))
if (f->getFile()->path() == path)
return true;
@@ -1409,21 +1409,19 @@ bool WinLinkDriver::parse(int argc, const char *argv[],
}
// Add the input files to the input graph.
- if (!ctx.hasInputGraph())
- ctx.setInputGraph(std::unique_ptr<InputGraph>(new InputGraph()));
for (std::unique_ptr<File> &file : files) {
if (isReadingDirectiveSection)
if (file->parse())
return false;
ctx.getResolvableSymsFile()->add(file.get());
- ctx.getInputGraph().members().push_back(
+ ctx.getNodes().push_back(
std::unique_ptr<Node>(new FileNode(std::move(file))));
}
// Add the library group to the input graph.
if (!isReadingDirectiveSection) {
// Add a group-end marker.
- ctx.getInputGraph().members().push_back(llvm::make_unique<GroupEnd>(0));
+ ctx.getNodes().push_back(llvm::make_unique<GroupEnd>(0));
}
// Add the library files to the library group.
OpenPOWER on IntegriCloud