diff options
| author | Rui Ueyama <ruiu@google.com> | 2015-01-15 07:15:36 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2015-01-15 07:15:36 +0000 |
| commit | 56206368f50070dd89bb4602016e4c4207bd4499 (patch) | |
| tree | cf6a24e9e65f27f077d303daa3b7408dae4282a1 /lld | |
| parent | f0982d0ac6daf6cad5952a968c4ec4a10713a2d2 (diff) | |
| download | bcm5719-llvm-56206368f50070dd89bb4602016e4c4207bd4499.tar.gz bcm5719-llvm-56206368f50070dd89bb4602016e4c4207bd4499.zip | |
Simplify FileNode.
The member function was defined to allow subclasses to customize
error message. But since we only have one FileNode type, there's
no actual need for that.
llvm-svn: 226139
Diffstat (limited to 'lld')
| -rw-r--r-- | lld/include/lld/Core/InputGraph.h | 6 | ||||
| -rw-r--r-- | lld/lib/Driver/Driver.cpp | 8 |
2 files changed, 5 insertions, 9 deletions
diff --git a/lld/include/lld/Core/InputGraph.h b/lld/include/lld/Core/InputGraph.h index 3d44bd487ea..1df63e1c3e9 100644 --- a/lld/include/lld/Core/InputGraph.h +++ b/lld/include/lld/Core/InputGraph.h @@ -149,12 +149,6 @@ public: return a->kind() == InputElement::Kind::File; } - /// \brief create an error string for printing purposes - virtual std::string errStr(std::error_code errc) { - std::string msg = errc.message(); - return (Twine("Cannot open ") + _path + ": " + msg).str(); - } - /// \brief Get the list of files File *getFile() { return _file.get(); } diff --git a/lld/lib/Driver/Driver.cpp b/lld/lib/Driver/Driver.cpp index dabcdf0751c..f059c0ee893 100644 --- a/lld/lib/Driver/Driver.cpp +++ b/lld/lib/Driver/Driver.cpp @@ -94,10 +94,12 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) { llvm::raw_string_ostream stream(buf); if (std::error_code ec = ie->parse(context, stream)) { - if (FileNode *fileNode = dyn_cast<FileNode>(ie.get())) - stream << fileNode->errStr(ec) << "\n"; - else + 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; } |

