[lld] r226145 - Remove WrapperNode.
Rui Ueyama
ruiu at google.com
Thu Jan 15 00:10:10 PST 2015
Author: ruiu
Date: Thu Jan 15 02:10:10 2015
New Revision: 226145
URL: http://llvm.org/viewvc/llvm-project?rev=226145&view=rev
Log:
Remove WrapperNode.
WrapperNode was a useless subclass of FileNode. We should just use
FileNode instead.
Removed:
lld/trunk/include/lld/Driver/WrapperInputGraph.h
Modified:
lld/trunk/lib/Driver/CoreDriver.cpp
lld/trunk/lib/Driver/DarwinLdDriver.cpp
lld/trunk/lib/Driver/Driver.cpp
lld/trunk/lib/Driver/GnuLdDriver.cpp
lld/trunk/lib/Driver/WinLinkDriver.cpp
lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
Removed: lld/trunk/include/lld/Driver/WrapperInputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/WrapperInputGraph.h?rev=226144&view=auto
==============================================================================
--- lld/trunk/include/lld/Driver/WrapperInputGraph.h (original)
+++ lld/trunk/include/lld/Driver/WrapperInputGraph.h (removed)
@@ -1,29 +0,0 @@
-//===- lld/Driver/WrapperInputGraph.h - dummy InputGraph node -------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_DRIVER_WRAPPER_INPUT_GRAPH_H
-#define LLD_DRIVER_WRAPPER_INPUT_GRAPH_H
-
-#include "lld/Core/InputGraph.h"
-#include "lld/ReaderWriter/CoreLinkingContext.h"
-#include "lld/ReaderWriter/Reader.h"
-#include "llvm/Support/Errc.h"
-#include <map>
-#include <memory>
-
-namespace lld {
-
-class WrapperNode : public FileNode {
-public:
- WrapperNode(std::unique_ptr<File> f) : FileNode(std::move(f)) {}
-};
-
-}
-
-#endif
Modified: lld/trunk/lib/Driver/CoreDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CoreDriver.cpp?rev=226145&r1=226144&r2=226145&view=diff
==============================================================================
--- lld/trunk/lib/Driver/CoreDriver.cpp (original)
+++ lld/trunk/lib/Driver/CoreDriver.cpp Thu Jan 15 02:10:10 2015
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
#include "lld/Driver/Driver.h"
-#include "lld/Driver/WrapperInputGraph.h"
#include "lld/ReaderWriter/CoreLinkingContext.h"
#include "lld/ReaderWriter/Reader.h"
#include "llvm/ADT/ArrayRef.h"
@@ -155,7 +154,7 @@ bool CoreDriver::parse(int argc, const c
= loadFile(ctx, inputArg->getValue(), false);
for (std::unique_ptr<File> &file : files) {
inputGraph->addInputElement(std::unique_ptr<InputElement>(
- new WrapperNode(std::move(file))));
+ new FileNode(std::move(file))));
}
break;
}
Modified: lld/trunk/lib/Driver/DarwinLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdDriver.cpp?rev=226145&r1=226144&r2=226145&view=diff
==============================================================================
--- lld/trunk/lib/Driver/DarwinLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/DarwinLdDriver.cpp Thu Jan 15 02:10:10 2015
@@ -17,7 +17,6 @@
#include "lld/Core/ArchiveLibraryFile.h"
#include "lld/Core/SharedLibraryFile.h"
#include "lld/Driver/Driver.h"
-#include "lld/Driver/WrapperInputGraph.h"
#include "lld/ReaderWriter/MachOLinkingContext.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
@@ -121,7 +120,7 @@ static void addFile(StringRef path, std:
loadFile(ctx, path, diag, loadWholeArchive, upwardDylib);
for (std::unique_ptr<File> &file : files)
inputGraph->addInputElement(
- llvm::make_unique<WrapperNode>(std::move(file)));
+ llvm::make_unique<FileNode>(std::move(file)));
}
// Export lists are one symbol per line. Blank lines are ignored.
Modified: lld/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/Driver.cpp?rev=226145&r1=226144&r2=226145&view=diff
==============================================================================
--- lld/trunk/lib/Driver/Driver.cpp (original)
+++ lld/trunk/lib/Driver/Driver.cpp Thu Jan 15 02:10:10 2015
@@ -15,7 +15,6 @@
#include "lld/Core/PassManager.h"
#include "lld/Core/Resolver.h"
#include "lld/Driver/Driver.h"
-#include "lld/Driver/WrapperInputGraph.h"
#include "lld/Passes/RoundTripNativePass.h"
#include "lld/Passes/RoundTripYAMLPass.h"
#include "lld/ReaderWriter/Reader.h"
@@ -120,7 +119,7 @@ bool Driver::link(LinkingContext &contex
context.createInternalFiles(internalFiles);
for (auto i = internalFiles.rbegin(), e = internalFiles.rend(); i != e; ++i) {
context.getInputGraph().addInputElementFront(
- llvm::make_unique<WrapperNode>(std::move(*i)));
+ llvm::make_unique<FileNode>(std::move(*i)));
}
// Give target a chance to add files.
@@ -128,7 +127,7 @@ bool Driver::link(LinkingContext &contex
context.createImplicitFiles(implicitFiles);
for (auto i = implicitFiles.rbegin(), e = implicitFiles.rend(); i != e; ++i) {
context.getInputGraph().addInputElementFront(
- llvm::make_unique<WrapperNode>(std::move(*i)));
+ llvm::make_unique<FileNode>(std::move(*i)));
}
// Give target a chance to sort the input files.
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=226145&r1=226144&r2=226145&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Thu Jan 15 02:10:10 2015
@@ -14,7 +14,6 @@
//===----------------------------------------------------------------------===//
#include "lld/Driver/Driver.h"
-#include "lld/Driver/WrapperInputGraph.h"
#include "lld/ReaderWriter/ELFLinkingContext.h"
#include "lld/ReaderWriter/LinkerScript.h"
#include "llvm/ADT/ArrayRef.h"
@@ -276,7 +275,7 @@ evaluateLinkerScript(ELFLinkingContext &
if (ctx.logInputFiles())
diag << file->path() << "\n";
inputGraph->addInputElement(
- std::unique_ptr<InputElement>(new WrapperNode(std::move(file))));
+ std::unique_ptr<InputElement>(new FileNode(std::move(file))));
++numfiles;
}
}
@@ -617,7 +616,7 @@ bool GnuLdDriver::parse(int argc, const
if (ctx->logInputFiles())
diagnostics << file->path() << "\n";
inputGraph->addInputElement(
- std::unique_ptr<InputElement>(new WrapperNode(std::move(file))));
+ std::unique_ptr<InputElement>(new FileNode(std::move(file))));
}
numfiles += files.size();
break;
Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=226145&r1=226144&r2=226145&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Thu Jan 15 02:10:10 2015
@@ -15,7 +15,6 @@
#include "lld/Driver/Driver.h"
#include "lld/Driver/WinLinkModuleDef.h"
-#include "lld/Driver/WrapperInputGraph.h"
#include "lld/ReaderWriter/PECOFFLinkingContext.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
@@ -1418,7 +1417,7 @@ bool WinLinkDriver::parse(int argc, cons
return false;
ctx.getResolvableSymsFile()->add(file.get());
ctx.getInputGraph().addInputElement(
- std::unique_ptr<InputElement>(new WrapperNode(std::move(file))));
+ std::unique_ptr<InputElement>(new FileNode(std::move(file))));
}
// Add the library group to the input graph.
@@ -1435,7 +1434,7 @@ bool WinLinkDriver::parse(int argc, cons
return false;
ctx.getResolvableSymsFile()->add(file.get());
ctx.addLibraryFile(
- std::unique_ptr<FileNode>(new WrapperNode(std::move(file))));
+ std::unique_ptr<FileNode>(new FileNode(std::move(file))));
}
}
Modified: lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp?rev=226145&r1=226144&r2=226145&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp Thu Jan 15 02:10:10 2015
@@ -17,7 +17,6 @@
#include "PDBPass.h"
#include "lld/Core/PassManager.h"
#include "lld/Core/Simple.h"
-#include "lld/Driver/WrapperInputGraph.h"
#include "lld/Passes/LayoutPass.h"
#include "lld/Passes/RoundTripNativePass.h"
#include "lld/Passes/RoundTripYAMLPass.h"
@@ -110,22 +109,22 @@ bool PECOFFLinkingContext::createImplici
pecoff::ResolvableSymbols* syms = getResolvableSymsFile();
// Create a file for the entry point function.
- std::unique_ptr<WrapperNode> entry(new WrapperNode(
+ std::unique_ptr<FileNode> entry(new FileNode(
llvm::make_unique<pecoff::EntryPointFile>(*this, syms)));
getInputGraph().addInputElementFront(std::move(entry));
// Create a file for __ImageBase.
- std::unique_ptr<WrapperNode> fileNode(new WrapperNode(
+ std::unique_ptr<FileNode> fileNode(new FileNode(
llvm::make_unique<pecoff::LinkerGeneratedSymbolFile>(*this)));
getInputGraph().addInputElement(std::move(fileNode));
// Create a file for _imp_ symbols.
- std::unique_ptr<WrapperNode> impFileNode(new WrapperNode(
+ std::unique_ptr<FileNode> impFileNode(new FileNode(
llvm::make_unique<pecoff::LocallyImportedSymbolFile>(*this)));
getInputGraph().addInputElement(std::move(impFileNode));
// Create a file for dllexported symbols.
- std::unique_ptr<WrapperNode> exportNode(new WrapperNode(
+ std::unique_ptr<FileNode> exportNode(new FileNode(
llvm::make_unique<pecoff::ExportedSymbolRenameFile>(*this, syms)));
addLibraryFile(std::move(exportNode));
More information about the llvm-commits
mailing list