summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ReaderLinkerScript.cpp
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2013-04-04 18:59:24 +0000
committerNick Kledzik <kledzik@apple.com>2013-04-04 18:59:24 +0000
commitc314b46e718bb5f23ca257af2331c120891361b2 (patch)
treeb0c6c6a9688cadb233589dc5e317df5d05d89cba /lld/lib/ReaderWriter/ReaderLinkerScript.cpp
parent83f1be1bfc3112d0edba33ed6d8e1a751844b06f (diff)
downloadbcm5719-llvm-c314b46e718bb5f23ca257af2331c120891361b2.tar.gz
bcm5719-llvm-c314b46e718bb5f23ca257af2331c120891361b2.zip
This is my Driver refactoring patch.
The major changes are: 1) LinkerOptions has been merged into TargetInfo 2) LinkerInvocation has been merged into Driver 3) Drivers no longer convert arguments into an intermediate (core) argument list, but instead create a TargetInfo object and call setter methods on it. This is only how in-process linking would work. That is, you can programmatically set up a TargetInfo object which controls the linking. 4) Lots of tweaks to test suite to work with driver changes 5) Add the DarwinDriver 6) I heavily doxygen commented TargetInfo.h Things to do after this patch is committed: a) Consider renaming TargetInfo, given its new roll. b) Consider pulling the list of input files out of TargetInfo. This will enable in-process clients to create one TargetInfo the re-use it with different input file lists. c) Work out a way for Drivers to format the warnings and error done in core linking. llvm-svn: 178776
Diffstat (limited to 'lld/lib/ReaderWriter/ReaderLinkerScript.cpp')
-rw-r--r--lld/lib/ReaderWriter/ReaderLinkerScript.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lld/lib/ReaderWriter/ReaderLinkerScript.cpp b/lld/lib/ReaderWriter/ReaderLinkerScript.cpp
index 4beb32a3bc6..646f97e7f46 100644
--- a/lld/lib/ReaderWriter/ReaderLinkerScript.cpp
+++ b/lld/lib/ReaderWriter/ReaderLinkerScript.cpp
@@ -11,7 +11,6 @@
#include "lld/Core/Error.h"
#include "lld/Core/File.h"
-#include "lld/Core/LinkerOptions.h"
#include "lld/ReaderWriter/LinkerScript.h"
using namespace lld;
@@ -81,8 +80,8 @@ private:
namespace lld {
error_code
-ReaderLinkerScript::parseFile(std::unique_ptr<llvm::MemoryBuffer> mb,
- std::vector<std::unique_ptr<File> > &result) {
+ReaderLinkerScript::parseFile(std::unique_ptr<llvm::MemoryBuffer> &mb,
+ std::vector<std::unique_ptr<File> > &result) const {
auto lsf = LinkerScriptFile::create(_targetInfo, std::move(mb));
if (!lsf)
return lsf;
@@ -91,10 +90,7 @@ ReaderLinkerScript::parseFile(std::unique_ptr<llvm::MemoryBuffer> mb,
for (const auto &c : ls->_commands) {
if (auto group = dyn_cast<Group>(c))
for (const auto &path : group->getPaths()) {
- auto reader = _getReader(LinkerInput(path._path));
- if (!reader)
- return reader;
- if (error_code ec = reader->readFile(path._path, result))
+ if (error_code ec = _targetInfo.readFile(path._path, result))
return ec;
}
}
OpenPOWER on IntegriCloud