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
This commit is contained in:
Reid Spencer 2007-08-16 07:23:37 +00:00
parent 3c1b4012b6
commit af11dc00a0

View File

@ -162,7 +162,8 @@ 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()))
if (M.get())
if (!LinkInModule(M.get(), &Error))
return false;
} else
Error = "standard input is empty";
@ -195,7 +196,7 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) {
std::auto_ptr<Module> 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() + "'");