summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-04-30 19:04:01 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-04-30 19:04:01 +0000
commita64f34b759bb19a49d9fcc6be6db8f703a9c79d7 (patch)
treeacecb63e11363876e443ca9e003cb6d36ea90e45 /lld/lib/Driver/Driver.cpp
parentdb8a4a8578af7703937c30b47ee3ffc9a952e6b4 (diff)
downloadbcm5719-llvm-a64f34b759bb19a49d9fcc6be6db8f703a9c79d7.tar.gz
bcm5719-llvm-a64f34b759bb19a49d9fcc6be6db8f703a9c79d7.zip
[Driver] Check type of InputElement before request a error message. If the
element is a FileNode, request error description. If the element is Group, print hard coded error message. We need to implement a better diagnostics here but even current solution is better than a segmentation fault output. llvm-svn: 207691
Diffstat (limited to 'lld/lib/Driver/Driver.cpp')
-rw-r--r--lld/lib/Driver/Driver.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lld/lib/Driver/Driver.cpp b/lld/lib/Driver/Driver.cpp
index 1122ae9bc54..f87bf5b16c3 100644
--- a/lld/lib/Driver/Driver.cpp
+++ b/lld/lib/Driver/Driver.cpp
@@ -63,8 +63,13 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) {
llvm::raw_string_ostream stream(buf);
if (error_code ec = ie->parse(context, stream)) {
- FileNode *fileNode = dyn_cast<FileNode>(ie.get());
- stream << fileNode->errStr(ec) << "\n";
+ if (FileNode *fileNode = dyn_cast<FileNode>(ie.get()))
+ stream << fileNode->errStr(ec) << "\n";
+ else if (dyn_cast<Group>(ie.get()))
+ // FIXME: We need a better diagnostics here
+ stream << "Cannot parse group input element\n";
+ else
+ llvm_unreachable("Unknown type of input element");
fail = true;
}
OpenPOWER on IntegriCloud