From af11dc00a0c70fde950f70bd13a43e7cbb98ef72 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Thu, 16 Aug 2007 07:23:37 +0000 Subject: [PATCH] Ensure that error messages a propagated from calls to LinkInModule so they get reported to the end user. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41117 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkItems.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp index ad0ccd2e3c1..976dee0353a 100644 --- a/lib/Linker/LinkItems.cpp +++ b/lib/Linker/LinkItems.cpp @@ -162,8 +162,9 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) { if (MemoryBuffer *Buffer = MemoryBuffer::getSTDIN()) { M.reset(ParseBitcodeFile(Buffer, &Error)); delete Buffer; - if (!LinkInModule(M.get())) - return false; + if (M.get()) + if (!LinkInModule(M.get(), &Error)) + return false; } else Error = "standard input is empty"; return error("Cannot link stdin: " + Error); @@ -195,7 +196,7 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) { std::auto_ptr M(LoadObject(File)); if (M.get() == 0) return error("Cannot load file '" + File.toString() + "'" + Error); - if (LinkInModule(M.get())) + if (LinkInModule(M.get(), &Error)) return error("Cannot link file '" + File.toString() + "'" + Error); verbose("Linked in file '" + File.toString() + "'"); -- 2.34.1