diff options
| author | Rui Ueyama <ruiu@google.com> | 2015-01-15 07:56:14 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2015-01-15 07:56:14 +0000 |
| commit | df3fca25200b3f558712b71f4575ae832afe91f3 (patch) | |
| tree | 5d17269503f05a12e390f7028f53f07a1abe848b /lld/lib/Driver/Driver.cpp | |
| parent | 7c4ba12769cf7e2347ea9021b023428cca2f5d20 (diff) | |
| download | bcm5719-llvm-df3fca25200b3f558712b71f4575ae832afe91f3.tar.gz bcm5719-llvm-df3fca25200b3f558712b71f4575ae832afe91f3.zip | |
Remove FileNode::parse.
FileNode::parse was just a forwarder to File::parse so we could remove that.
Also removed dead code.
llvm-svn: 226144
Diffstat (limited to 'lld/lib/Driver/Driver.cpp')
| -rw-r--r-- | lld/lib/Driver/Driver.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lld/lib/Driver/Driver.cpp b/lld/lib/Driver/Driver.cpp index 9882b550a6e..5d9d6807f4a 100644 --- a/lld/lib/Driver/Driver.cpp +++ b/lld/lib/Driver/Driver.cpp @@ -93,14 +93,14 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) { std::string buf; llvm::raw_string_ostream stream(buf); - if (std::error_code ec = ie->parse(context, stream)) { - if (FileNode *fileNode = dyn_cast<FileNode>(ie.get())) { - stream << "Cannot open " + fileNode->getFile()->path() - << ": " << ec.message() << "\n"; - } else { - llvm_unreachable("Unknown type of input element"); - } - fail = true; + if (FileNode *node = dyn_cast<FileNode>(ie.get())) { + if (File *file = node->getFile()) { + if (std::error_code ec = file->parse()) { + stream << "Cannot open " + file->path() + << ": " << ec.message() << "\n"; + fail = true; + } + } } stream.flush(); @@ -116,7 +116,7 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) { if (fail) return false; - InputGraph::FileVectorT internalFiles; + std::vector<std::unique_ptr<File>> internalFiles; context.createInternalFiles(internalFiles); for (auto i = internalFiles.rbegin(), e = internalFiles.rend(); i != e; ++i) { context.getInputGraph().addInputElementFront( @@ -124,7 +124,7 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) { } // Give target a chance to add files. - InputGraph::FileVectorT implicitFiles; + std::vector<std::unique_ptr<File>> implicitFiles; context.createImplicitFiles(implicitFiles); for (auto i = implicitFiles.rbegin(), e = implicitFiles.rend(); i != e; ++i) { context.getInputGraph().addInputElementFront( |

